pub trait Zeroize {
// Required method
fn zeroize(&mut self);
}
Expand description
Trait to zeroize a memory buffer. Trait for securely erasing values from memory.
Required Methods§
fn zeroize(&mut self)
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§
§impl Zeroize for NonZeroI64
impl Zeroize for NonZeroI64
§impl<A, B, C, D, E, F, G, H> Zeroize for (A, B, C, D, E, F, G, H)where
A: Zeroize,
B: Zeroize,
C: Zeroize,
D: Zeroize,
E: Zeroize,
F: Zeroize,
G: Zeroize,
H: Zeroize,
impl<A, B, C, D, E, F, G, H> Zeroize for (A, B, C, D, E, F, G, H)where A: Zeroize, B: Zeroize, C: Zeroize, D: Zeroize, E: Zeroize, F: Zeroize, G: Zeroize, H: Zeroize,
§impl Zeroize for PhantomPinned
impl Zeroize for PhantomPinned
PhantomPinned
is zero sized so provide a Zeroize implementation.
§impl<Z> Zeroize for PhantomData<Z>
impl<Z> Zeroize for PhantomData<Z>
PhantomData
is always zero sized so provide a Zeroize
implementation.
§impl<A, B, C, D, E, F, G> Zeroize for (A, B, C, D, E, F, G)where
A: Zeroize,
B: Zeroize,
C: Zeroize,
D: Zeroize,
E: Zeroize,
F: Zeroize,
G: Zeroize,
impl<A, B, C, D, E, F, G> Zeroize for (A, B, C, D, E, F, G)where A: Zeroize, B: Zeroize, C: Zeroize, D: Zeroize, E: Zeroize, F: Zeroize, G: Zeroize,
§impl<Z> Zeroize for [MaybeUninit<Z>]
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.
§impl Zeroize for NonZeroI128
impl Zeroize for NonZeroI128
§impl Zeroize for NonZeroU64
impl Zeroize for NonZeroU64
§impl Zeroize for NonZeroU16
impl Zeroize for NonZeroU16
§impl Zeroize for NonZeroU128
impl Zeroize for NonZeroU128
§impl Zeroize for NonZeroI16
impl Zeroize for NonZeroI16
§impl<A, B, C, D, E, F, G, H, I, J> Zeroize for (A, B, C, D, E, F, G, H, I, J)where
A: Zeroize,
B: Zeroize,
C: Zeroize,
D: Zeroize,
E: Zeroize,
F: Zeroize,
G: Zeroize,
H: Zeroize,
I: Zeroize,
J: Zeroize,
impl<A, B, C, D, E, F, G, H, I, J> Zeroize for (A, B, C, D, E, F, G, H, I, J)where A: Zeroize, B: Zeroize, C: Zeroize, D: Zeroize, E: Zeroize, F: Zeroize, G: Zeroize, H: Zeroize, I: Zeroize, J: Zeroize,
§impl Zeroize for NonZeroIsize
impl Zeroize for NonZeroIsize
§impl<A, B, C, D, E> Zeroize for (A, B, C, D, E)where
A: Zeroize,
B: Zeroize,
C: Zeroize,
D: Zeroize,
E: Zeroize,
impl<A, B, C, D, E> Zeroize for (A, B, C, D, E)where A: Zeroize, B: Zeroize, C: Zeroize, D: Zeroize, E: Zeroize,
§impl Zeroize for NonZeroI32
impl Zeroize for NonZeroI32
§impl Zeroize for NonZeroUsize
impl Zeroize for NonZeroUsize
§impl<A, B, C, D, E, F, G, H, I> Zeroize for (A, B, C, D, E, F, G, H, I)where
A: Zeroize,
B: Zeroize,
C: Zeroize,
D: Zeroize,
E: Zeroize,
F: Zeroize,
G: Zeroize,
H: Zeroize,
I: Zeroize,
impl<A, B, C, D, E, F, G, H, I> Zeroize for (A, B, C, D, E, F, G, H, I)where A: Zeroize, B: Zeroize, C: Zeroize, D: Zeroize, E: Zeroize, F: Zeroize, G: Zeroize, H: Zeroize, I: Zeroize,
§impl Zeroize for NonZeroU32
impl Zeroize for NonZeroU32
§impl<Z> Zeroize for [Z]where
Z: DefaultIsZeroes,
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()
.
§impl<A> Zeroize for (A,)where
A: Zeroize,
impl<A> Zeroize for (A,)where A: Zeroize,
Generic implementation of Zeroize for tuples up to 10 parameters.