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.