pub trait ErrorExtensions: Sized {
    fn extend(&self) -> Error;

    fn extend_with<C>(self, cb: C) -> Error
    where
        C: FnOnce(&Self, &mut ErrorExtensionValues)
, { ... } }
Expand description

An error which can be extended into a Error.

Required Methods§

Convert the error to a Error.

Provided Methods§

Add extensions to the error, using a callback to make the extensions.

Examples found in repository?
src/error.rs (line 460)
455
456
457
458
459
460
461
462
463
    fn extend_err<C>(self, cb: C) -> Result<T>
    where
        C: FnOnce(&E, &mut ErrorExtensionValues),
    {
        match self {
            Err(err) => Err(err.extend_with(|e, ee| cb(e, ee))),
            Ok(value) => Ok(value),
        }
    }

Implementations on Foreign Types§

Implementors§