pub trait AssertZeroizeOnDrop {
// Required methods
fn clone_sentinel(&self) -> ZeroizeOnDropSentinel;
fn assert_zeroize_on_drop(self);
}Expand description
Trait for types that verify zeroization happened before drop.
Types implementing this trait contain a ZeroizeOnDropSentinel and provide
methods to verify that .zeroize() was called before the value is dropped.
This trait is typically derived using #[derive(RedoubtZero)] from the RedoubtZero crate.
Required Methods§
Sourcefn clone_sentinel(&self) -> ZeroizeOnDropSentinel
fn clone_sentinel(&self) -> ZeroizeOnDropSentinel
Clones the internal ZeroizeOnDropSentinel for verification.
This is used by assert_zeroize_on_drop
to verify zeroization after the value is dropped.
Sourcefn assert_zeroize_on_drop(self)
fn assert_zeroize_on_drop(self)
Asserts that zeroization happens when this value is dropped.
§Panics
Panics if .zeroize() was not called before drop.
This is typically used in tests to verify drop behavior for types that implement this trait.