pub struct SecretBytes(/* private fields */);Expand description
Implementations§
Source§impl SecretBytes
impl SecretBytes
Sourcepub fn expose_secret(&self) -> &[u8] ⓘ
pub fn expose_secret(&self) -> &[u8] ⓘ
Borrows the secret as a &[u8] for use without taking ownership.
All uses of this function should be carefully reviewed to ensure the value is not printed or copied to a non-Secret-wrapped storage. The borrow does not change ownership and the secret is still zeroed on drop.
Sourcepub fn into_vec(self) -> Vec<u8> ⓘ
pub fn into_vec(self) -> Vec<u8> ⓘ
Consumes the wrapper and returns the plain owned Vec<u8>.
This is the ownership-handoff path for when a secret must leave the
library boundary. The moved-out value is not zeroized (that is the
point of handoff); the caller then owns leak prevention. No wrapped copy
remains, because self is consumed by value.
Trait Implementations§
Source§impl Clone for SecretBytes
impl Clone for SecretBytes
Source§fn clone(&self) -> SecretBytes
fn clone(&self) -> SecretBytes
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SecretBytes
impl Debug for SecretBytes
Source§impl Drop for SecretBytes
impl Drop for SecretBytes
Auto Trait Implementations§
impl Freeze for SecretBytes
impl RefUnwindSafe for SecretBytes
impl Send for SecretBytes
impl Sync for SecretBytes
impl Unpin for SecretBytes
impl UnsafeUnpin for SecretBytes
impl UnwindSafe for SecretBytes
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