Skip to main content

ResultErrorWhile

Trait ResultErrorWhile 

Source
pub trait ResultErrorWhile<C> {
    type ContextError;

    // Required methods
    fn error_while(self, context: C) -> Self::ContextError;
    fn error_while_with<F>(self, context: F) -> Self::ContextError
       where F: FnOnce() -> C;
}
Expand description

Add context to error carried by another type like Result

Required Associated Types§

Required Methods§

Source

fn error_while(self, context: C) -> Self::ContextError

Source

fn error_while_with<F>(self, context: F) -> Self::ContextError
where F: FnOnce() -> C,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<O, E, C> ResultErrorWhile<C> for Result<O, E>
where E: WithContext<C, ContextError = E>,

Source§

type ContextError = Result<O, E>

Source§

fn error_while(self, context: C) -> Self

Source§

fn error_while_with<F>(self, context: F) -> Self::ContextError
where F: FnOnce() -> C,

Implementors§