pub trait DMSCErrorContext<T, E> {
// Required methods
fn chain_context<S>(self, context: S) -> Result<T, DMSCErrorChain>
where S: Into<String>;
fn with_chain_context<S, F>(self, f: F) -> Result<T, DMSCErrorChain>
where S: Into<String>,
F: FnOnce() -> S;
}Expand description
Trait for adding error chain functionality to Result types.
Required Methods§
Sourcefn chain_context<S>(self, context: S) -> Result<T, DMSCErrorChain>
fn chain_context<S>(self, context: S) -> Result<T, DMSCErrorChain>
Adds context to the error if the Result is Err.
Sourcefn with_chain_context<S, F>(self, f: F) -> Result<T, DMSCErrorChain>
fn with_chain_context<S, F>(self, f: F) -> Result<T, DMSCErrorChain>
Adds context to the error with lazy evaluation.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.