pub struct Sensitive<T>(T);Expand description
An opaque wrapper for sensitive values; Debug and Display always redact.
use wowlab_types::sensitive::Sensitive;
let token = Sensitive::new("my-secret-token".to_string());
assert_eq!(format!("{:?}", token), "Sensitive(\"[REDACTED]\")");
assert_eq!(format!("{}", token), "[REDACTED]");
assert_eq!(token.expose(), "my-secret-token");Tuple Fields§
§0: TImplementations§
Trait Implementations§
impl<T: Eq> Eq for Sensitive<T>
impl<T> StructuralPartialEq for Sensitive<T>
Auto Trait Implementations§
impl<T> Freeze for Sensitive<T>where
T: Freeze,
impl<T> RefUnwindSafe for Sensitive<T>where
T: RefUnwindSafe,
impl<T> Send for Sensitive<T>where
T: Send,
impl<T> Sync for Sensitive<T>where
T: Sync,
impl<T> Unpin for Sensitive<T>where
T: Unpin,
impl<T> UnsafeUnpin for Sensitive<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Sensitive<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of [
ToCompactString::to_compact_string()] Read more§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a [
CompactString]. Read more