pub trait OptionContext<T> {
// Required methods
fn context_none(self, context: impl Into<String>) -> Result<T>;
fn with_context_none<F, C>(self, f: F) -> Result<T>
where F: FnOnce() -> C,
C: Into<String>;
}Expand description
Extension trait for Option types to convert to errors with context.
Required Methods§
Sourcefn context_none(self, context: impl Into<String>) -> Result<T>
fn context_none(self, context: impl Into<String>) -> Result<T>
Convert None to an error with the given context.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".