pub struct SecretVec { /* private fields */ }
Expand description
Variable-size secret vector that guarantees zeroization
This type provides:
- Automatic zeroization on drop
- Secure cloning that preserves security properties
- Dynamic sizing with secure memory management
Implementations§
Source§impl SecretVec
impl SecretVec
Sourcepub fn from_slice(slice: &[u8]) -> Self
pub fn from_slice(slice: &[u8]) -> Self
Create a secret vector from a slice
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a secret vector with the specified capacity
Sourcepub fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
pub fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
Get a mutable reference to the inner data
Sourcepub fn extend_from_slice(&mut self, slice: &[u8])
pub fn extend_from_slice(&mut self, slice: &[u8])
Extend the vector with additional data
Trait Implementations§
Source§impl SecureZeroingType for SecretVec
impl SecureZeroingType for SecretVec
Auto Trait Implementations§
impl Freeze for SecretVec
impl RefUnwindSafe for SecretVec
impl Send for SecretVec
impl Sync for SecretVec
impl Unpin for SecretVec
impl UnwindSafe for SecretVec
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