Trait easy_error::ResultExt [−][src]
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>
[src]
Adds some context to the error.
fn with_context<S: ToString, F: FnOnce() -> S>(self, ctx_fn: F) -> Result<T>
[src]
Adds context to the error, evaluating the context function only if there
is an Err
.