pub trait ResultBugWithContext<T> {
// Required method
fn with_context(self, context: impl Display) -> Result<T, Bug>;
}
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, Bug>
fn with_context(self, context: impl Display) -> Result<T, Bug>
Add a context to the Bug wrapped in a Result::Err
§Examples
Err::<(), _>(Bug::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.