ErrorContext

Trait ErrorContext 

Source
pub trait ErrorContext<Context, Target> {
    // Required methods
    fn context(self, ctx: Context) -> Target;
    fn context_with<F: Fn() -> Context>(self, ctx: F) -> Target;
}
Expand description

Reverse implemented for Result<T, E> where E: IntoErrorContext

Required Methods§

Source

fn context(self, ctx: Context) -> Target

Source

fn context_with<F: Fn() -> Context>(self, ctx: F) -> Target

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<Context, Target, T, E: IntoErrorContext<Context, Target>> ErrorContext<E, Result<T, Target>> for Result<T, Context>

Source§

fn context(self, ctx: E) -> Result<T, Target>

Source§

fn context_with<F: Fn() -> E>(self, ctx: F) -> Result<T, Target>

Implementors§