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>
where T: Copy + Debug + ToBlake3Hash,

source

pub fn new() -> Self

Initialize a ZeroizeArray with the value of specified by the array of bytes

source

pub fn new_with(value: [T; N]) -> Self

Initialize a ZeroizeArray with the value of specified by the array of bytes

source

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]

source

pub fn expose_borrowed(&self) -> &ArrayVec<T, N>

Expose the internal as an borrowed array

source

pub fn own(self) -> Self

Own this array

source

pub fn push(&mut self, value: T) -> &mut Self

Insert a value in the array after the last index

source

pub fn insert(&mut self, index: usize, value: T) -> &mut Self

Insert a value at index specified in the array

Trait Implementations§

source§

impl<const N: usize, T: Debug + ToBlake3Hash> Debug for ZeroizeArrayVec<N, T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<const N: usize, T: Debug + ToBlake3Hash + Copy> Default for ZeroizeArrayVec<N, T>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<const N: usize, T: Debug + ToBlake3Hash> Drop for ZeroizeArrayVec<N, T>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<const N: usize, T: Debug + ToBlake3Hash> PartialEq for ZeroizeArrayVec<N, T>

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<const N: usize, T: Debug + ToBlake3Hash> Zeroize for ZeroizeArrayVec<N, T>

source§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler.
source§

impl<const N: usize, T: Debug + ToBlake3Hash> Eq for ZeroizeArrayVec<N, T>

source§

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V