pub struct SecretString(/* private fields */);Expand description
A string value that should not appear in logs, Debug output, or serialized JSON.
Debugprints[REDACTED](or""if empty)Serializeemits an empty string (never the actual value)Deserializeaccepts a plain string (backward compatible with old configs)Displayprints[REDACTED](or empty if the value is empty)expose()returns the inner value for actual use
Implementations§
Trait Implementations§
Source§impl Clone for SecretString
impl Clone for SecretString
Source§fn clone(&self) -> SecretString
fn clone(&self) -> SecretString
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SecretString
impl Debug for SecretString
Source§impl Default for SecretString
impl Default for SecretString
Source§fn default() -> SecretString
fn default() -> SecretString
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for SecretString
impl<'de> Deserialize<'de> for SecretString
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 Display for SecretString
impl Display for SecretString
Source§impl From<&str> for SecretString
impl From<&str> for SecretString
Source§impl From<String> for SecretString
impl From<String> for SecretString
Source§impl PartialEq for SecretString
impl PartialEq for SecretString
Auto Trait Implementations§
impl Freeze for SecretString
impl RefUnwindSafe for SecretString
impl Send for SecretString
impl Sync for SecretString
impl Unpin for SecretString
impl UnsafeUnpin for SecretString
impl UnwindSafe for SecretString
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