pub trait Context<D> {
type Output;
// Required methods
fn context(self, msg: &'static str) -> Self::Output;
fn with_context<F, M>(self, with_msg: F) -> Self::Output
where F: FnOnce() -> M,
M: Display;
}Expand description
Context for Result-like types
Required Associated Types§
Required Methods§
Sourcefn context(self, msg: &'static str) -> Self::Output
fn context(self, msg: &'static str) -> Self::Output
Adds context to this result, if it’s an error
Sourcefn with_context<F, M>(self, with_msg: F) -> Self::Output
fn with_context<F, M>(self, with_msg: F) -> Self::Output
Adds context to this result lazily, if it’s an error
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.