pub trait ErrorContext<T> {
    // Required methods
    fn error<M: Into<Cow<'static, str>>>(self, message: M) -> Result<T>;
    fn or_error<M: Into<Cow<'static, str>>, F: FnOnce() -> M>(
        self,
        f: F
    ) -> Result<T>;
}

Required Methods§

source

fn error<M: Into<Cow<'static, str>>>(self, message: M) -> Result<T>

source

fn or_error<M: Into<Cow<'static, str>>, F: FnOnce() -> M>( self, f: F ) -> Result<T>

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T> ErrorContext<T> for Option<T>

source§

fn error<M: Into<Cow<'static, str>>>(self, message: M) -> Result<T>

source§

fn or_error<M: Into<Cow<'static, str>>, F: FnOnce() -> M>( self, f: F ) -> Result<T>

Implementors§

source§

impl<T, E: StdError + Send + Sync + 'static> ErrorContext<T> for Result<T, E>