pub struct SecretBuffer<const N: usize> { /* private fields */ }
Expand description
Fixed-size secret buffer that guarantees zeroization
This type provides:
- Automatic zeroization on drop
- Secure cloning that preserves security properties
- Type-safe size guarantees at compile time
Implementations§
Source§impl<const N: usize> SecretBuffer<N>
impl<const N: usize> SecretBuffer<N>
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
Trait Implementations§
Source§impl<const N: usize> Clone for SecretBuffer<N>
impl<const N: usize> Clone for SecretBuffer<N>
Source§fn clone(&self) -> SecretBuffer<N>
fn clone(&self) -> SecretBuffer<N>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<const N: usize> Debug for SecretBuffer<N>
impl<const N: usize> Debug for SecretBuffer<N>
Source§impl<const N: usize> Drop for SecretBuffer<N>
impl<const N: usize> Drop for SecretBuffer<N>
Source§impl<const N: usize> SecureZeroingType for SecretBuffer<N>
impl<const N: usize> SecureZeroingType for SecretBuffer<N>
Auto Trait Implementations§
impl<const N: usize> Freeze for SecretBuffer<N>
impl<const N: usize> RefUnwindSafe for SecretBuffer<N>
impl<const N: usize> Send for SecretBuffer<N>
impl<const N: usize> Sync for SecretBuffer<N>
impl<const N: usize> Unpin for SecretBuffer<N>
impl<const N: usize> UnwindSafe for SecretBuffer<N>
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