Trait ResultErrorContext

Source
pub(crate) trait ResultErrorContext {
    // Required method
    fn err_context<C: Display, F: FnOnce() -> C>(self, context: F) -> Self;
}
Expand description

Give results context in case of error.

Lifts the ErrorContext trait to Result types.

Required Methods§

Source

fn err_context<C: Display, F: FnOnce() -> C>(self, context: F) -> Self

Give context if self is an error.

If self is an error, prepend the given context.

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<V, E: ErrorContext> ResultErrorContext for Result<V, E>

Source§

fn err_context<C: Display, F: FnOnce() -> C>(self, context: F) -> Self

Implementors§