pub struct Redacted(/* private fields */);Expand description
A string value that prints <redacted> in Debug and Display
output.
Use expose to access the inner value when you
genuinely need it (e.g. for sending over the wire). The Debug and
Display implementations are generated by the derive_more crate.
§Examples
use openvpn_mgmt_codec::Redacted;
let secret = Redacted::new("hunter2");
assert_eq!(format!("{secret:?}"), "<redacted>");
assert_eq!(format!("{secret}"), "<redacted>");
assert_eq!(secret.expose(), "hunter2");Implementations§
Source§impl Redacted
impl Redacted
Trait Implementations§
impl Eq for Redacted
impl StructuralPartialEq for Redacted
Auto Trait Implementations§
impl Freeze for Redacted
impl RefUnwindSafe for Redacted
impl Send for Redacted
impl Sync for Redacted
impl Unpin for Redacted
impl UnsafeUnpin for Redacted
impl UnwindSafe for Redacted
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