pub struct ZeroizeGuard<'a, T>where
T: Zeroize,{ /* private fields */ }
Expand description
Guard type that ensures a value is zeroized when dropped
This is useful for ensuring cleanup happens even in the presence of early returns or panics.
Implementations§
Source§impl<'a, T> ZeroizeGuard<'a, T>where
T: Zeroize,
impl<'a, T> ZeroizeGuard<'a, T>where
T: Zeroize,
Sourcepub fn new(value: &'a mut T) -> ZeroizeGuard<'a, T>
pub fn new(value: &'a mut T) -> ZeroizeGuard<'a, T>
Create a new zeroize guard for the given value
Trait Implementations§
Source§impl<T> Deref for ZeroizeGuard<'_, T>where
T: Zeroize,
impl<T> Deref for ZeroizeGuard<'_, T>where
T: Zeroize,
Source§impl<T> DerefMut for ZeroizeGuard<'_, T>where
T: Zeroize,
impl<T> DerefMut for ZeroizeGuard<'_, T>where
T: Zeroize,
Auto Trait Implementations§
impl<'a, T> Freeze for ZeroizeGuard<'a, T>
impl<'a, T> RefUnwindSafe for ZeroizeGuard<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for ZeroizeGuard<'a, T>where
T: Send,
impl<'a, T> Sync for ZeroizeGuard<'a, T>where
T: Sync,
impl<'a, T> Unpin for ZeroizeGuard<'a, T>
impl<'a, T> !UnwindSafe for ZeroizeGuard<'a, T>
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