Trait ResultExt

Source
pub trait ResultExt<T> {
    // Required methods
    fn context<C>(self, context: C) -> Result<T, Error>
       where C: Into<Cow<'static, str>>;
    fn with_context<C, F>(self, f: F) -> Result<T, Error>
       where C: Into<Cow<'static, str>>,
             F: FnOnce() -> C;
}

Required Methods§

Source

fn context<C>(self, context: C) -> Result<T, Error>
where C: Into<Cow<'static, str>>,

Source

fn with_context<C, F>(self, f: F) -> Result<T, Error>
where C: Into<Cow<'static, str>>, F: FnOnce() -> C,

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<T> ResultExt<T> for Result<T, Error>

Source§

fn context<C>(self, context: C) -> Result<T, Error>
where C: Into<Cow<'static, str>>,

Source§

fn with_context<C, F>(self, f: F) -> Result<T, Error>
where C: Into<Cow<'static, str>>, F: FnOnce() -> C,

Implementors§