[][src]Trait extracterr::Bundle

pub trait Bundle<T, C> {
    type Bundled;
    fn bundle(self, context: C) -> Result<T, Self::Bundled>;
}

Extension trait for bundling context with errors through Result types

Associated Types

type Bundled

The output error type after bundling with the provided context

Loading content...

Required methods

fn bundle(self, context: C) -> Result<T, Self::Bundled>

use extracterr::{Bundle, Bundled};

struct Dummy(i32);

fn do_thing() -> Result<(), std::io::Error> {
    // ...
}

let r = do_thing().bundle(Dummy(0)); //: Result<(), Bundled<std::io::Error, Dummy>>
Loading content...

Implementations on Foreign Types

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

type Bundled = Bundled<E, C>

Loading content...

Implementors

Loading content...