[][src]Trait err_ctx::ResultExt

pub trait ResultExt<T, E> where
    E: Into<Box<dyn Error + Send + Sync>>, 
{ fn ctx<D>(self, context: D) -> Result<T, Context<D>>;
fn with_ctx<D>(
        self,
        f: impl FnOnce(&E) -> D
    ) -> Result<T, Context<D>>; }

Required methods

fn ctx<D>(self, context: D) -> Result<T, Context<D>>

If this Result is an Err, wrap the error with context.

fn with_ctx<D>(
    self,
    f: impl FnOnce(&E) -> D
) -> Result<T, Context<D>>

If this Result is an Err, invoke f and wrap the error with its result.

Loading content...

Implementations on Foreign Types

impl<T, E> ResultExt<T, E> for Result<T, E> where
    E: Into<Box<dyn Error + Send + Sync>>, 
[src]

Loading content...

Implementors

Loading content...