pub trait RiErrorContext<T, E> {
// Required methods
fn chain_context<S>(self, context: S) -> Result<T, RiErrorChain>
where S: Into<String>;
fn with_chain_context<S, F>(self, f: F) -> Result<T, RiErrorChain>
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, RiErrorChain>
fn chain_context<S>(self, context: S) -> Result<T, RiErrorChain>
Adds context to the error if the Result is Err.
Sourcefn with_chain_context<S, F>(self, f: F) -> Result<T, RiErrorChain>
fn with_chain_context<S, F>(self, f: F) -> Result<T, RiErrorChain>
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".