pub struct Secret(/* private fields */);Expand description
Bytes that are wiped when dropped.
A Secret owns its bytes and zeroes them (with volatile writes the optimizer cannot remove)
when it goes away, so a token read from the keychain does not linger in freed memory. It is
built from a string or bytes, read back as either, compared in constant time, and prints as
Secret(<n> bytes) so a stray {:?} never logs it.
Implementations§
Trait Implementations§
impl Eq for Secret
Auto Trait Implementations§
impl Freeze for Secret
impl RefUnwindSafe for Secret
impl Send for Secret
impl Sync for Secret
impl Unpin for Secret
impl UnsafeUnpin for Secret
impl UnwindSafe for Secret
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