Struct memsecurity::ZeroizeArrayVec
source · pub struct ZeroizeArrayVec<const N: usize, T: Debug + ToBlake3Hash>(/* private fields */);
Expand description
This is an ArrayVec whose size is specified as a const generic N
and can be zeroed out when dropped from memory.
This array is useful when specifying fixed size bytes like passwords which need to be zeroed out from memory before being dropped.
Structure
use arrayvec::ArrayVec;
pub struct ZeroizeArrayVec<const N: usize, T>(ArrayVec<T, N>);
Implementations§
source§impl<const N: usize, T> ZeroizeArrayVec<N, T>
impl<const N: usize, T> ZeroizeArrayVec<N, T>
sourcepub fn new() -> Self
pub fn new() -> Self
Initialize a ZeroizeArray with the value of specified by the array of bytes
sourcepub fn new_with(value: [T; N]) -> Self
pub fn new_with(value: [T; N]) -> Self
Initialize a ZeroizeArray with the value of specified by the array of bytes
sourcepub fn fill_from_slice(&mut self, value: [T; N]) -> &mut Self
pub fn fill_from_slice(&mut self, value: [T; N]) -> &mut Self
File the current array with new values specified by the method parameter value: [u8; N]
sourcepub fn expose_borrowed(&self) -> &ArrayVec<T, N>
pub fn expose_borrowed(&self) -> &ArrayVec<T, N>
Expose the internal as an borrowed array
Trait Implementations§
source§impl<const N: usize, T: Debug + ToBlake3Hash> Debug for ZeroizeArrayVec<N, T>
impl<const N: usize, T: Debug + ToBlake3Hash> Debug for ZeroizeArrayVec<N, T>
source§impl<const N: usize, T: Debug + ToBlake3Hash + Copy> Default for ZeroizeArrayVec<N, T>
impl<const N: usize, T: Debug + ToBlake3Hash + Copy> Default for ZeroizeArrayVec<N, T>
source§impl<const N: usize, T: Debug + ToBlake3Hash> Drop for ZeroizeArrayVec<N, T>
impl<const N: usize, T: Debug + ToBlake3Hash> Drop for ZeroizeArrayVec<N, T>
source§impl<const N: usize, T: Debug + ToBlake3Hash> PartialEq for ZeroizeArrayVec<N, T>
impl<const N: usize, T: Debug + ToBlake3Hash> PartialEq for ZeroizeArrayVec<N, T>
source§impl<const N: usize, T: Debug + ToBlake3Hash> Zeroize for ZeroizeArrayVec<N, T>
impl<const N: usize, T: Debug + ToBlake3Hash> Zeroize for ZeroizeArrayVec<N, T>
impl<const N: usize, T: Debug + ToBlake3Hash> Eq for ZeroizeArrayVec<N, T>
impl<const N: usize, T: Debug + ToBlake3Hash> ZeroizeOnDrop for ZeroizeArrayVec<N, T>
Auto Trait Implementations§
impl<const N: usize, T> RefUnwindSafe for ZeroizeArrayVec<N, T>where
T: RefUnwindSafe,
impl<const N: usize, T> Send for ZeroizeArrayVec<N, T>where
T: Send,
impl<const N: usize, T> Sync for ZeroizeArrayVec<N, T>where
T: Sync,
impl<const N: usize, T> Unpin for ZeroizeArrayVec<N, T>where
T: Unpin,
impl<const N: usize, T> UnwindSafe for ZeroizeArrayVec<N, 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