pub struct Zeroizing<T: Zeroize>(/* private fields */);Expand description
A wrapper that zeroizes its contents when dropped.
use ic_core::Zeroizing;
let mut key = Zeroizing::new([0u8; 32]);
key[0] = 0x42;
assert_eq!(key[0], 0x42);
// `key` is wiped when it leaves scope.Implementations§
Trait Implementations§
impl<T: Eq + Zeroize> Eq for Zeroizing<T>
impl<T: PartialEq + Zeroize> StructuralPartialEq for Zeroizing<T>
Auto Trait Implementations§
impl<T> Freeze for Zeroizing<T>where
T: Freeze,
impl<T> RefUnwindSafe for Zeroizing<T>where
T: RefUnwindSafe,
impl<T> Send for Zeroizing<T>where
T: Send,
impl<T> Sync for Zeroizing<T>where
T: Sync,
impl<T> Unpin for Zeroizing<T>where
T: Unpin,
impl<T> UnsafeUnpin for Zeroizing<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Zeroizing<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more