Trait utils::anytrace::Context

source ·
pub trait Context<T, E> {
    // Required method
    fn context(self, error: E) -> Result<T>;
}
Expand description

Trait for converting error types to a Result<T>.

Required Methods§

source

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

Attach context to the given error.

§Errors

Propagates errors from self

Implementations on Foreign Types§

source§

impl<'a, T> Context<&'a mut T, Error> for &'a mut Option<T>

source§

fn context(self, error: Error) -> Result<&'a mut T>

source§

impl<T> Context<T, Error> for Option<T>

source§

fn context(self, error: Error) -> Result<T>

Implementors§

source§

impl<T> Context<T, Error> for Result<T>

source§

impl<T, F> Context<T, F> for Result<T>
where F: Fn(Error) -> Error,