OptionExt

Trait OptionExt 

Source
pub trait OptionExt<T>: Sized {
    // Required methods
    fn context_and_location<C, E>(
        self,
        context: C,
        location: Location,
    ) -> Result<T, E>
       where C: ErrorWrap<NoneError, E>,
             E: Error2;
    fn with_context_and_location<F, C, E>(
        self,
        f: F,
        location: Location,
    ) -> Result<T, E>
       where F: FnOnce() -> C,
             C: ErrorWrap<NoneError, E>,
             E: Error2;

    // Provided methods
    fn context<C, E>(self, context: C) -> Result<T, E>
       where C: ErrorWrap<NoneError, E>,
             E: Error2 { ... }
    fn with_context<F, C, E>(self, f: F) -> Result<T, E>
       where F: FnOnce() -> C,
             C: ErrorWrap<NoneError, E>,
             E: Error2 { ... }
}

Required Methods§

Source

fn context_and_location<C, E>( self, context: C, location: Location, ) -> Result<T, E>
where C: ErrorWrap<NoneError, E>, E: Error2,

Source

fn with_context_and_location<F, C, E>( self, f: F, location: Location, ) -> Result<T, E>
where F: FnOnce() -> C, C: ErrorWrap<NoneError, E>, E: Error2,

Provided Methods§

Source

fn context<C, E>(self, context: C) -> Result<T, E>
where C: ErrorWrap<NoneError, E>, E: Error2,

Source

fn with_context<F, C, E>(self, f: F) -> Result<T, E>
where F: FnOnce() -> C, C: ErrorWrap<NoneError, E>, E: 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> OptionExt<T> for Option<T>

Source§

fn context_and_location<C, E>( self, context: C, location: Location, ) -> Result<T, E>
where C: ErrorWrap<NoneError, E>, E: Error2,

Source§

fn with_context_and_location<F, C, E>( self, f: F, location: Location, ) -> Result<T, E>
where F: FnOnce() -> C, C: ErrorWrap<NoneError, E>, E: Error2,

Implementors§