pub trait ErrorContext: 'static {
// Required method
fn add_context(err: &mut Error, state: &State);
}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: &mut Error, state: &State)
fn add_context(err: &mut Error, state: &State)
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".