Skip to main content

ErrorContext

Trait ErrorContext 

Source
pub trait ErrorContext<T> {
    // Required methods
    fn with_context<K, V>(self, key: K, value: V) -> Result<T, JsonPathError>
       where K: Into<String>,
             V: Into<String>;
    fn with_contexts<I, K, V>(self, contexts: I) -> Result<T, JsonPathError>
       where I: IntoIterator<Item = (K, V)>,
             K: Into<String>,
             V: Into<String>;
}
Expand description

Extension trait for adding context to errors

Required Methods§

Source

fn with_context<K, V>(self, key: K, value: V) -> Result<T, JsonPathError>
where K: Into<String>, V: Into<String>,

Source

fn with_contexts<I, K, V>(self, contexts: I) -> Result<T, JsonPathError>
where I: IntoIterator<Item = (K, V)>, K: Into<String>, V: Into<String>,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T> ErrorContext<T> for Result<T, JsonPathError>

Source§

fn with_context<K, V>(self, key: K, value: V) -> Result<T, JsonPathError>
where K: Into<String>, V: Into<String>,

Source§

fn with_contexts<I, K, V>(self, contexts: I) -> Result<T, JsonPathError>
where I: IntoIterator<Item = (K, V)>, K: Into<String>, V: Into<String>,

Implementors§