pub struct Secret<S>where
S: Zeroize,{ /* private fields */ }
Expand description
Wrapper type for values that contains secrets, which attempts to limit accidental exposure and ensure secrets are wiped from memory when dropped. (e.g. passwords, cryptographic keys, access tokens or other credentials)
Access to the secret inner value occurs through the ExposeSecret
trait,
which provides an expose_secret()
method for accessing the inner secret
value.
Implementations§
Trait Implementations§
source§impl<S> Clone for Secret<S>where
S: CloneableSecret,
impl<S> Clone for Secret<S>where
S: CloneableSecret,
source§impl<S> ExposeSecret<S> for Secret<S>where
S: Zeroize,
impl<S> ExposeSecret<S> for Secret<S>where
S: Zeroize,
source§fn expose_secret(&self) -> &S
fn expose_secret(&self) -> &S
Expose secret: this is the only method providing access to a secret.
Auto Trait Implementations§
impl<S> Freeze for Secret<S>where
S: Freeze,
impl<S> RefUnwindSafe for Secret<S>where
S: RefUnwindSafe,
impl<S> Send for Secret<S>where
S: Send,
impl<S> Sync for Secret<S>where
S: Sync,
impl<S> Unpin for Secret<S>where
S: Unpin,
impl<S> UnwindSafe for Secret<S>where
S: UnwindSafe,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)