Trait ResultErrorWhileWrap

Source
pub trait ResultErrorWhileWrap<O, E, C> {
    // Required methods
    fn wrap_error_while(self, context: C) -> Result<O, ErrorContext<E, C>>;
    fn wrap_error_while_with<F>(
        self,
        context: F,
    ) -> Result<O, ErrorContext<E, C>>
       where F: FnOnce() -> C;
}
Expand description

Result extension trait to wrap error value in ErrorContext with given context information

Required Methods§

Source

fn wrap_error_while(self, context: C) -> Result<O, ErrorContext<E, C>>

Source

fn wrap_error_while_with<F>(self, context: F) -> Result<O, ErrorContext<E, C>>
where F: FnOnce() -> C,

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<O, E, C> ResultErrorWhileWrap<O, E, C> for Result<O, E>
where E: WrapContext<C, ContextError = ErrorContext<E, C>>,

Source§

fn wrap_error_while(self, context: C) -> Result<O, ErrorContext<E, C>>

Source§

fn wrap_error_while_with<F>(self, context: F) -> Result<O, ErrorContext<E, C>>
where F: FnOnce() -> C,

Implementors§