pub struct SecretString<T>(/* private fields */)
where
T: AsRef<str>;Expand description
A string wrapper that hides its contents when printed or formatted for debugging.
§Examples
use secret_string::SecretString;
let secret = SecretString::new("my_secret_password");
assert_eq!(format!("{}", secret), "******************");
assert_eq!(format!("{:?}", secret), "SecretString(******************)");
assert_eq!(secret.value(), "my_secret_password");Implementations§
Trait Implementations§
Source§impl Debug for SecretString<&str>
impl Debug for SecretString<&str>
Auto Trait Implementations§
impl<T> Freeze for SecretString<T>where
T: Freeze,
impl<T> RefUnwindSafe for SecretString<T>where
T: RefUnwindSafe,
impl<T> Send for SecretString<T>where
T: Send,
impl<T> Sync for SecretString<T>where
T: Sync,
impl<T> Unpin for SecretString<T>where
T: Unpin,
impl<T> UnwindSafe for SecretString<T>where
T: 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