Skip to main content

SecureErrorHandling

Trait SecureErrorHandling 

Source
pub trait SecureErrorHandling<T, E>: Sized {
    // Required method
    fn secure_unwrap<F>(self, default: T, on_error: F) -> T
       where F: FnOnce() -> E,
             E: Send + 'static;
}
Expand description

Legacy name for ErrorRegistryExt.

Despite its historical name, this trait has never provided constant-time execution: it branches on Result, invokes only the selected path, and records an error only on failure.

Required Methods§

Source

fn secure_unwrap<F>(self, default: T, on_error: F) -> T
where F: FnOnce() -> E, E: Send + 'static,

👎Deprecated:

secure_unwrap is not constant-time; use ErrorRegistryExt::unwrap_or_record_with for non-secret control flow

Return the successful value, or record on_error() and return default.

This method is not constant-time and must not be used when the Result variant is secret.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T, E> SecureErrorHandling<T, E> for Result<T, E>

Source§

fn secure_unwrap<F>(self, default: T, on_error: F) -> T
where F: FnOnce() -> E, E: Send + 'static,

👎Deprecated:

secure_unwrap is not constant-time; use ErrorRegistryExt::unwrap_or_record_with for non-secret control flow

Implementors§