pub trait ErrorContext: 'static {
// Required method
fn add_context(err: Error, state: &State) -> Error;
}Expand description
Adds context to errors, see State::add_error_context.
This is typically implemented by the extension type which holds the information that is attached to errors.
Required Methods§
Sourcefn add_context(err: Error, state: &State) -> Error
fn add_context(err: Error, state: &State) -> Error
Adds context to an error.
This is invoked with the state as it was when the error happened. Context that is already attached to the error should not be replaced.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".