pub trait ResultFaultWithContext<T> {
// Required method
fn with_context(self, context: impl Display) -> Result<T, Fault>;
}
Expand description
To use this trait on Result import the prelude use explicit_error::prelude::*
Required Methods§
Sourcefn with_context(self, context: impl Display) -> Result<T, Fault>
fn with_context(self, context: impl Display) -> Result<T, Fault>
Add a context to the Fault wrapped in a Result::Err
§Examples
Err::<(), _>(Fault::new()).with_context("Foo bar");
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.