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§
Sourcefn error_trace(self, trace: impl Into<Cow<'static, str>>) -> Selfwhere
Self: Sized,
fn error_trace(self, trace: impl Into<Cow<'static, str>>) -> Selfwhere
Self: Sized,
Wraps the error with error trace.
Sourcefn detailed_error_trace(
self,
trace: impl Into<Cow<'static, str>>,
file: &'static str,
line: u32,
) -> Selfwhere
Self: Sized,
fn detailed_error_trace(
self,
trace: impl Into<Cow<'static, str>>,
file: &'static str,
line: u32,
) -> Selfwhere
Self: Sized,
Wraps the error with detailed error trace including file and line information.
Sourcefn with_error_trace<F, R>(self, f: F) -> Self
fn with_error_trace<F, R>(self, f: F) -> Self
Wraps the error with lazily evaluated error trace.