ErrorContext

Trait ErrorContext 

Source
pub trait ErrorContext {
    type Source: Error;
    type Err: Error;

    // Required method
    fn add_to_source(self, source: Self::Source) -> Self::Err;
}
Expand description

Trait for types which can add context to some Error (Source), transforming it into a new Error (Err).

Required Associated Types§

Source

type Source: Error

The source error type which this context can be added to.

Source

type Err: Error

The new error type after adding this context.

Required Methods§

Source

fn add_to_source(self, source: Self::Source) -> Self::Err

Add this context to the given error Source, transforming it into Err.

Implementors§