Lines Matching defs:context
3 #![cfg_attr(not(feature = "error-context"), allow(dead_code))]
4 #![cfg_attr(not(feature = "error-context"), allow(unused_imports))]
5 #![cfg_attr(not(feature = "error-context"), allow(unused_variables))]
6 #![cfg_attr(not(feature = "error-context"), allow(unused_mut))]
7 #![cfg_attr(not(feature = "error-context"), allow(clippy::let_and_return))]
28 #[cfg(feature = "error-context")]
29 mod context;
37 #[cfg(feature = "error-context")]
38 pub use context::ContextKind;
39 #[cfg(feature = "error-context")]
40 pub use context::ContextValue;
41 #[cfg(feature = "error-context")]
44 #[cfg(not(feature = "error-context"))]
46 #[cfg(feature = "error-context")]
67 #[cfg(feature = "error-context")]
68 context: FlatMap<ContextKind, ContextValue>,
90 /// Format the existing message with the Command's context
109 #[cfg_attr(not(feature = "error-context"), doc = " ```ignore")]
110 #[cfg_attr(feature = "error-context", doc = " ```")]
128 #[cfg(feature = "error-context")]
129 context: FlatMap::new(),
178 #[cfg(feature = "error-context")]
179 pub fn context(&self) -> impl Iterator<Item = (ContextKind, &ContextValue)> {
180 self.inner.context.iter().map(|(k, v)| (*k, v))
183 /// Lookup a piece of context
185 #[cfg(feature = "error-context")]
187 self.inner.context.get(&kind)
190 /// Insert a piece of context
192 #[cfg(feature = "error-context")]
194 self.inner.context.insert(kind, value)
310 #[cfg(feature = "error-context")]
316 self.inner.context.insert_unchecked(kind, value);
322 #[cfg(feature = "error-context")]
325 context: [(ContextKind, ContextValue); N],
327 self.inner.context.extend_unchecked(context);
355 #[cfg(feature = "error-context")]
382 #[cfg(feature = "error-context")]
404 #[cfg(feature = "error-context")]
434 #[cfg(feature = "error-context")]
472 #[cfg(feature = "error-context")]
494 #[cfg(feature = "error-context")]
517 #[cfg(feature = "error-context")]
538 #[cfg(feature = "error-context")]
557 #[cfg(feature = "error-context")]
581 #[cfg(feature = "error-context")]
610 #[cfg(feature = "error-context")]
630 #[cfg(feature = "error-context")]
661 #[cfg(feature = "error-context")]
718 #[cfg(feature = "error-context")]