Trait zeroize::Zeroize

source ·
pub trait Zeroize {
    // Required method
    fn zeroize(&mut self);
}
Expand description

Trait for securely erasing types from memory

Required Methods§

source

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler.

Implementations on Foreign Types§

source§

impl Zeroize for String

source§

fn zeroize(&mut self)

source§

impl Zeroize for __m128

source§

fn zeroize(&mut self)

source§

impl Zeroize for __m128d

source§

fn zeroize(&mut self)

source§

impl Zeroize for __m128i

source§

fn zeroize(&mut self)

source§

impl Zeroize for NonZeroI8

source§

fn zeroize(&mut self)

source§

impl Zeroize for NonZeroI16

source§

fn zeroize(&mut self)

source§

impl Zeroize for NonZeroI32

source§

fn zeroize(&mut self)

source§

impl Zeroize for NonZeroI64

source§

fn zeroize(&mut self)

source§

impl Zeroize for NonZeroI128

source§

fn zeroize(&mut self)

source§

impl Zeroize for NonZeroIsize

source§

fn zeroize(&mut self)

source§

impl Zeroize for NonZeroU8

source§

fn zeroize(&mut self)

source§

impl Zeroize for NonZeroU16

source§

fn zeroize(&mut self)

source§

impl Zeroize for NonZeroU32

source§

fn zeroize(&mut self)

source§

impl Zeroize for NonZeroU64

source§

fn zeroize(&mut self)

source§

impl Zeroize for NonZeroU128

source§

fn zeroize(&mut self)

source§

impl Zeroize for NonZeroUsize

source§

fn zeroize(&mut self)

source§

impl<'a, Z> Zeroize for IterMut<'a, Z>
where Z: Zeroize,

source§

fn zeroize(&mut self)

source§

impl<Z> Zeroize for Option<Z>
where Z: Zeroize,

source§

fn zeroize(&mut self)

source§

impl<Z> Zeroize for [Z]
where Z: DefaultIsZeroes,

Impl Zeroize on slices of types that can be zeroized with Default.

This impl can eventually be optimized using an memset intrinsic, such as core::intrinsics::volatile_set_memory. For that reason the blanket impl on slices is bounded by DefaultIsZeroes.

To zeroize a mut slice of Z: Zeroize which does not impl DefaultIsZeroes, call iter_mut().zeroize().

source§

fn zeroize(&mut self)

source§

impl<Z> Zeroize for Box<[Z]>
where Z: Zeroize,

source§

fn zeroize(&mut self)

Unlike Vec, Box<[Z]> cannot reallocate, so we can be sure that we are not leaving values on the heap.

source§

impl<Z> Zeroize for Vec<Z>
where Z: Zeroize,

source§

fn zeroize(&mut self)

“Best effort” zeroization for Vec.

Ensures the entire capacity of the Vec is zeroed. Cannot ensure that previous reallocations did not leave values on the heap.

source§

impl<Z> Zeroize for [MaybeUninit<Z>]

Impl Zeroize on slices of MaybeUninit types This impl can eventually be optimized using an memset intrinsic, such as core::intrinsics::volatile_set_memory. This fills the slice with zeros Note that this ignore invariants that Z might have, because MaybeUninit removes all invariants.

source§

fn zeroize(&mut self)

source§

impl<Z, const N: usize> Zeroize for [Z; N]
where Z: Zeroize,

Implement Zeroize on arrays of types that impl Zeroize

source§

fn zeroize(&mut self)

Implementors§

source§

impl<Z> Zeroize for Zeroizing<Z>
where Z: Zeroize,

source§

impl<Z> Zeroize for Z
where Z: DefaultIsZeroes,