pub trait StopContext<T>: Sized {
// Required methods
fn stop_context(self, context: &'static str) -> Result<T, OrStopped>;
fn unwrap_stopped(self, value: T) -> Result<T>;
}Expand description
Extension trait for Result<_, OrStopped> similar to anyhow::Context.
Required Methods§
Sourcefn stop_context(self, context: &'static str) -> Result<T, OrStopped>
fn stop_context(self, context: &'static str) -> Result<T, OrStopped>
Adds context to the internal error, if any.
Sourcefn unwrap_stopped(self, value: T) -> Result<T>
fn unwrap_stopped(self, value: T) -> Result<T>
Unwraps the Stopped variant to the supplied value, and the Internal variant to the underlying anyhow::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.