Trait anyerror::AddContext

source ·
pub trait AddContext<T, Err, CtxErr> {
    // Required method
    fn add_context<D, F>(self, f: F) -> Result<T, CtxErr>
       where D: Display,
             F: FnOnce() -> D;
}
Expand description

The trait to add error context info to a Result<T, E>

Required Methods§

source

fn add_context<D, F>(self, f: F) -> Result<T, CtxErr>where D: Display, F: FnOnce() -> D,

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T> AddContext<T, AnyError, AnyError> for Result<T, AnyError>

When adding context info, convert an AnyError to another AnyError.

source§

fn add_context<D, F>(self, f: F) -> Result<T, AnyError>where D: Display, F: FnOnce() -> D,

Implementors§