Struct secrecy::Secret [−][src]
pub struct Secret<S> where
S: Zeroize, { /* fields omitted */ }
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
impl<'de, T> Deserialize<'de> for Secret<T> where
T: Zeroize + Clone + DeserializeOwned + Sized,
impl<'de, T> Deserialize<'de> for Secret<T> where
T: Zeroize + Clone + DeserializeOwned + Sized,
Deserialize this value from the given Serde deserializer. Read more
Expose secret: this is the only method providing access to a secret.
Auto Trait Implementations
impl<S> RefUnwindSafe for Secret<S> where
S: RefUnwindSafe,
impl<S> UnwindSafe for Secret<S> where
S: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more