pub struct Secret(/* private fields */);Expand description
A secret string — a token, a key, a webhook secret.
Wiped from memory when dropped, and its Debug is a fixed placeholder so
a stray {:?} or tracing::debug!(?x) cannot write it to a log. There is
deliberately no Display, Serialize or Clone: getting the value out
takes an explicit Secret::expose, which is easy to grep for.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Secret
impl RefUnwindSafe for Secret
impl Send for Secret
impl Sync for Secret
impl Unpin for Secret
impl UnsafeUnpin for Secret
impl UnwindSafe for Secret
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