zeroize

Trait Zeroize

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

Trait for securely erasing values 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 str

Source§

fn zeroize(&mut self)

Source§

impl Zeroize for Box<str>

Source§

fn zeroize(&mut self)

Source§

impl Zeroize for String

Source§

fn zeroize(&mut self)

Source§

impl Zeroize for uint8x8_t

Source§

fn zeroize(&mut self)

Source§

impl Zeroize for uint8x16_t

Source§

fn zeroize(&mut self)

Source§

impl Zeroize for uint16x4_t

Source§

fn zeroize(&mut self)

Source§

impl Zeroize for uint16x8_t

Source§

fn zeroize(&mut self)

Source§

impl Zeroize for uint32x2_t

Source§

fn zeroize(&mut self)

Source§

impl Zeroize for uint32x4_t

Source§

fn zeroize(&mut self)

Source§

impl Zeroize for uint64x1_t

Source§

fn zeroize(&mut self)

Source§

impl Zeroize for uint64x2_t

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: Zeroize> Zeroize for (A,)

Source§

fn zeroize(&mut self)

Source§

impl<A: Zeroize, B: Zeroize> Zeroize for (A, B)

Source§

fn zeroize(&mut self)

Source§

impl<A: Zeroize, B: Zeroize, C: Zeroize> Zeroize for (A, B, C)

Source§

fn zeroize(&mut self)

Source§

impl<A: Zeroize, B: Zeroize, C: Zeroize, D: Zeroize> Zeroize for (A, B, C, D)

Source§

fn zeroize(&mut self)

Source§

impl<A: Zeroize, B: Zeroize, C: Zeroize, D: Zeroize, E: Zeroize> Zeroize for (A, B, C, D, E)

Source§

fn zeroize(&mut self)

Source§

impl<A: Zeroize, B: Zeroize, C: Zeroize, D: Zeroize, E: Zeroize, F: Zeroize> Zeroize for (A, B, C, D, E, F)

Source§

fn zeroize(&mut self)

Source§

impl<A: Zeroize, B: Zeroize, C: Zeroize, D: Zeroize, E: Zeroize, F: Zeroize, G: Zeroize> Zeroize for (A, B, C, D, E, F, G)

Source§

fn zeroize(&mut self)

Source§

impl<A: Zeroize, B: Zeroize, C: Zeroize, D: Zeroize, E: Zeroize, F: Zeroize, G: Zeroize, H: Zeroize> Zeroize for (A, B, C, D, E, F, G, H)

Source§

fn zeroize(&mut self)

Source§

impl<A: Zeroize, B: Zeroize, C: Zeroize, D: Zeroize, E: Zeroize, F: Zeroize, G: Zeroize, H: Zeroize, I: Zeroize> Zeroize for (A, B, C, D, E, F, G, H, I)

Source§

fn zeroize(&mut self)

Source§

impl<A: Zeroize, B: Zeroize, C: Zeroize, D: Zeroize, E: Zeroize, F: Zeroize, G: Zeroize, H: Zeroize, I: Zeroize, J: Zeroize> Zeroize for (A, B, C, D, E, F, G, H, I, J)

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 PhantomData<Z>

PhantomData is always zero sized so provide a Zeroize implementation.

Source§

fn zeroize(&mut self)

Source§

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

Source§

fn zeroize(&mut self)

Source§

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

Source§

fn zeroize(&mut self)

Source§

impl<Z> Zeroize for MaybeUninit<Z>

Impl Zeroize on MaybeUninit types.

This fills the memory with zeroes. Note that this ignore invariants that Z might have, because MaybeUninit removes all invariants.

Source§

fn zeroize(&mut self)

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 zeroes.

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,

Impl 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,