[][src]Trait easy_error::ResultExt

pub trait ResultExt<T> {
    fn context<S: ToString>(self, ctx: S) -> Result<T>;
fn with_context<S: ToString, F: FnOnce() -> S>(self, ctx_fn: F) -> Result<T>; }

Extension methods to the Result type.

Required methods

fn context<S: ToString>(self, ctx: S) -> Result<T>

Adds some context to the error.

fn with_context<S: ToString, F: FnOnce() -> S>(self, ctx_fn: F) -> Result<T>

Adds context to the error, evaluating the context function only if there is an Err.

Loading content...

Implementations on Foreign Types

impl<T, E> ResultExt<T> for Result<T, E> where
    E: Error + Send + 'static, 
[src]

Loading content...

Implementors

Loading content...