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;
}
Expand description

Trait for secure error handling to prevent timing attacks

Required Methods§

Source

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

Handle errors in constant time

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,

Implementors§