pub trait ErrorRegistryExt<T, E>: Sized {
// Required method
fn unwrap_or_record_with<F>(self, default: T, on_error: F) -> T
where F: FnOnce() -> E,
E: Send + 'static;
}Expand description
Result extension for recording an error before returning a fallback value.
This operation uses ordinary branching on the Result discriminant. It is
intended for diagnostics and must not be used when the success/failure state
itself is secret.
Required Methods§
Sourcefn unwrap_or_record_with<F>(self, default: T, on_error: F) -> T
fn unwrap_or_record_with<F>(self, default: T, on_error: F) -> T
Return the successful value, or record on_error() and return default.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".