Skip to main content

SecureZeroingType

Trait SecureZeroingType 

Source
pub trait SecureZeroingType: Zeroize + Clone {
    // Required method
    fn zeroed() -> Self;

    // Provided method
    fn secure_clone(&self) -> Self { ... }
}
Expand description

Trait for types that explicitly clear owned storage and preserve that behavior when cloned.

Required Methods§

Source

fn zeroed() -> Self

Create a zeroed instance

Provided Methods§

Source

fn secure_clone(&self) -> Self

Create a clone with the same owned-storage cleanup behavior.

Each clone owns a separate copy and must be cleared independently.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl SecureZeroingType for SecretVec

Available on crate feature alloc only.
Source§

impl<const N: usize> SecureZeroingType for SecretBuffer<N>