pub struct SecretValue(/* private fields */);Expand description
A secret value held in protected memory.
Wraps secrecy::SecretBox so the bytes are zeroized on drop and never
appear in Debug output; there is no Display impl by design (I12).
The value is reachable only via SecretValue::expose, which callers must
invoke deliberately.
The serde impls (de)serialize the raw bytes and exist only so a record
can be serialized into the buffer that is immediately AEAD-sealed (see
crate::crypto); the plaintext serialization is never persisted or logged.
Implementations§
Trait Implementations§
Source§impl Debug for SecretValue
Redacted Debug: never reveals the value (I12). No Display impl exists.
impl Debug for SecretValue
Redacted Debug: never reveals the value (I12). No Display impl exists.
Source§impl<'de> Deserialize<'de> for SecretValue
impl<'de> Deserialize<'de> for SecretValue
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&str> for SecretValue
impl From<&str> for SecretValue
Source§impl From<String> for SecretValue
impl From<String> for SecretValue
Source§impl PartialEq for SecretValue
impl PartialEq for SecretValue
Auto Trait Implementations§
impl Freeze for SecretValue
impl RefUnwindSafe for SecretValue
impl Send for SecretValue
impl Sync for SecretValue
impl Unpin for SecretValue
impl UnsafeUnpin for SecretValue
impl UnwindSafe for SecretValue
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