pub trait StackableErr {
    type Output;

    // Required methods
    fn stack_err<K: Into<ErrorKind>, F: FnOnce() -> K>(
        self,
        f: F
    ) -> Self::Output;
    fn stack_err_locationless<K: Into<ErrorKind>, F: FnOnce() -> K>(
        self,
        f: F
    ) -> Self::Output;
    fn stack(self) -> Self::Output;
    fn stack_locationless(self) -> Self::Output;
}
Expand description

Conversion to and addition to the stack of an Error.

See the main crate documentation and implementation for examples.

Required Associated Types§

Required Methods§

source

fn stack_err<K: Into<ErrorKind>, F: FnOnce() -> K>(self, f: F) -> Self::Output

Pushes the result of f and location information to the stack

source

fn stack_err_locationless<K: Into<ErrorKind>, F: FnOnce() -> K>( self, f: F ) -> Self::Output

Pushes the result of f without location information

source

fn stack(self) -> Self::Output

Pushes just location information to the stack

source

fn stack_locationless(self) -> Self::Output

Only converts to Self::Output

Implementations on Foreign Types§

source§

impl<T> StackableErr for Result<T, Error>

§

type Output = Result<T, Error>

source§

fn stack_err<K: Into<ErrorKind>, F: FnOnce() -> K>(self, f: F) -> Self::Output

source§

fn stack_err_locationless<K: Into<ErrorKind>, F: FnOnce() -> K>( self, f: F ) -> Self::Output

source§

fn stack(self) -> Self::Output

source§

fn stack_locationless(self) -> Self::Output

source§

impl<T> StackableErr for Option<T>

§

type Output = Result<T, Error>

source§

fn stack_err<K: Into<ErrorKind>, F: FnOnce() -> K>(self, f: F) -> Self::Output

source§

fn stack_err_locationless<K: Into<ErrorKind>, F: FnOnce() -> K>( self, f: F ) -> Self::Output

source§

fn stack(self) -> Self::Output

source§

fn stack_locationless(self) -> Self::Output

source§

impl<T, E: Error + Send + Sync + 'static> StackableErr for Result<T, E>

§

type Output = Result<T, Error>

source§

fn stack_err<K: Into<ErrorKind>, F: FnOnce() -> K>(self, f: F) -> Self::Output

source§

fn stack_err_locationless<K: Into<ErrorKind>, F: FnOnce() -> K>( self, f: F ) -> Self::Output

source§

fn stack(self) -> Self::Output

source§

fn stack_locationless(self) -> Self::Output

Implementors§