pub trait ResultExt<T> {
// Required methods
fn with_context<F>(self, f: F) -> Result<T>
where F: FnOnce() -> String;
fn context(self, msg: &'static str) -> Result<T>;
}Expand description
Result extension trait for adding context to errors
Required Methods§
Sourcefn with_context<F>(self, f: F) -> Result<T>
fn with_context<F>(self, f: F) -> Result<T>
Add context to an error result
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.
Implementations on Foreign Types§
Source§impl<T, E> ResultExt<T> for Result<T, E>where
E: Into<ValknutError>,
ResultExt implementation for results with errors convertible to ValknutError.
impl<T, E> ResultExt<T> for Result<T, E>where
E: Into<ValknutError>,
ResultExt implementation for results with errors convertible to ValknutError.