pub trait WithContext<T> {
// Required method
fn with_context(self, ctx: &str) -> Result<T>;
}Expand description
Attach a context string to a Result, wrapping the error in a new
General message that includes the original error’s display text.
Required Methods§
Sourcefn with_context(self, ctx: &str) -> Result<T>
fn with_context(self, ctx: &str) -> Result<T>
Wrap any error with an additional context prefix.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".