pub trait ErrorContext<T> {
// Required methods
fn context(self, msg: &str) -> Result<T>;
fn with_context<F>(self, f: F) -> Result<T>
where F: FnOnce() -> String;
fn with_operation(self, operation: &str) -> Result<T>;
fn with_location(self, file: &str, line: u32) -> Result<T>;
}Expand description
Enhanced error context trait for better error propagation
Required Methods§
Sourcefn with_context<F>(self, f: F) -> Result<T>
fn with_context<F>(self, f: F) -> Result<T>
Add context with a lazy-evaluated closure
Sourcefn with_operation(self, operation: &str) -> Result<T>
fn with_operation(self, operation: &str) -> Result<T>
Add operation context for debugging
Sourcefn with_location(self, file: &str, line: u32) -> Result<T>
fn with_location(self, file: &str, line: u32) -> Result<T>
Add location context for debugging
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".