stacked_errors

Trait StackableErr

Source
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 a stackable_error::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 error 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 to the error stack

Source

fn stack(self) -> Self::Output

Pushes just location information to the error stack

Source

fn stack_locationless(self) -> Self::Output

Only converts to Self::Output and pushes it on the error stack

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> StackableErr for Option<T>

Source§

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 Result<T, Error>

Source§

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>

Source§

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§