ResultExt

Trait ResultExt 

Source
pub trait ResultExt<T, E1>: Sized {
    // Required methods
    fn context_and_location<C, E2, E3>(
        self,
        context: C,
        location: Location,
    ) -> Result<T, E3>
       where E1: Into<E2>,
             C: ErrorWrap<E2, E3>,
             E2: Error,
             E3: Error2;
    fn with_context_and_location<F, C, E2, E3>(
        self,
        f: F,
        location: Location,
    ) -> Result<T, E3>
       where F: FnOnce() -> C,
             E1: Into<E2>,
             C: ErrorWrap<E2, E3>,
             E2: Error,
             E3: Error2;

    // Provided methods
    fn context<C, E2, E3>(self, context: C) -> Result<T, E3>
       where E1: Into<E2>,
             C: ErrorWrap<E2, E3>,
             E2: Error,
             E3: Error2 { ... }
    fn with_context<F, C, E2, E3>(self, f: F) -> Result<T, E3>
       where F: FnOnce() -> C,
             E1: Into<E2>,
             C: ErrorWrap<E2, E3>,
             E2: Error,
             E3: Error2 { ... }
}

Required Methods§

Source

fn context_and_location<C, E2, E3>( self, context: C, location: Location, ) -> Result<T, E3>
where E1: Into<E2>, C: ErrorWrap<E2, E3>, E2: Error, E3: Error2,

Source

fn with_context_and_location<F, C, E2, E3>( self, f: F, location: Location, ) -> Result<T, E3>
where F: FnOnce() -> C, E1: Into<E2>, C: ErrorWrap<E2, E3>, E2: Error, E3: Error2,

Provided Methods§

Source

fn context<C, E2, E3>(self, context: C) -> Result<T, E3>
where E1: Into<E2>, C: ErrorWrap<E2, E3>, E2: Error, E3: Error2,

Source

fn with_context<F, C, E2, E3>(self, f: F) -> Result<T, E3>
where F: FnOnce() -> C, E1: Into<E2>, C: ErrorWrap<E2, E3>, E2: Error, E3: Error2,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T, E1> ResultExt<T, E1> for Result<T, E1>

Source§

fn context_and_location<C, E2, E3>( self, context: C, location: Location, ) -> Result<T, E3>
where E1: Into<E2>, C: ErrorWrap<E2, E3>, E2: Error, E3: Error2,

Source§

fn with_context_and_location<F, C, E2, E3>( self, f: F, location: Location, ) -> Result<T, E3>
where F: FnOnce() -> C, E1: Into<E2>, C: ErrorWrap<E2, E3>, E2: Error, E3: Error2,

Implementors§