ErrorTraceExt

Trait ErrorTraceExt 

Source
pub trait ErrorTraceExt: ErrorTrace {
    // Provided methods
    fn error_trace(self, trace: impl Into<Cow<'static, str>>) -> Self
       where Self: Sized { ... }
    fn detailed_error_trace(
        self,
        trace: impl Into<Cow<'static, str>>,
        file: &'static str,
        line: u32,
    ) -> Self
       where Self: Sized { ... }
    fn with_error_trace<F, R>(self, f: F) -> Self
       where F: FnOnce() -> R,
             R: Into<Cow<'static, str>>,
             Self: Sized { ... }
    fn with_detailed_error_trace<F, R>(
        self,
        f: F,
        file: &'static str,
        line: u32,
    ) -> Self
       where F: FnOnce() -> R,
             R: Into<Cow<'static, str>>,
             Self: Sized { ... }
}
Expand description

Extension trait providing ergonomic error trace addition methods.

This trait extends ErrorTrace with convenient methods for adding error traces when converting or working with errors. It provides both immediate and lazy evaluation options.

Provided Methods§

Source

fn error_trace(self, trace: impl Into<Cow<'static, str>>) -> Self
where Self: Sized,

Wraps the error with error trace.

Source

fn detailed_error_trace( self, trace: impl Into<Cow<'static, str>>, file: &'static str, line: u32, ) -> Self
where Self: Sized,

Wraps the error with detailed error trace including file and line information.

Source

fn with_error_trace<F, R>(self, f: F) -> Self
where F: FnOnce() -> R, R: Into<Cow<'static, str>>, Self: Sized,

Wraps the error with lazily evaluated error trace.

Source

fn with_detailed_error_trace<F, R>( self, f: F, file: &'static str, line: u32, ) -> Self
where F: FnOnce() -> R, R: Into<Cow<'static, str>>, Self: Sized,

Wraps the error with lazily evaluated detailed error trace including file and line information.

Implementors§