pub fn assert_zeroize_on_drop<T: AssertZeroizeOnDrop>(value: T)Expand description
Asserts that a value zeroizes itself when dropped.
This function verifies that the ZeroizeOnDropSentinel of the given value
is marked as zeroized after the value is dropped.
§Panics
Panics if the value’s .zeroize() method was not called during drop.
§How It Works
- Clones the value’s
ZeroizeOnDropSentinel - Resets the sentinel to “not zeroized” state
- Drops the value
- Asserts the sentinel was marked as zeroized
Typically used in tests for types that implement AssertZeroizeOnDrop.