pub struct RedactedDebug<'a, T: ?Sized> { /* private fields */ }Expand description
A borrowed value whose debug representation is always <redacted>.
This wrapper does not require or invoke T’s Debug implementation. It
retains the borrow so the wrapper cannot outlive the value it protects.
ⓘ
#![deny(unused_must_use)]
use qubit_redact::redacted_debug;
let secret = String::from("secret");
redacted_debug(&secret);§Type Parameters
'a- Lifetime of the protected borrowed value.T- Protected value type, which need not implementDebug.
Trait Implementations§
Source§impl<T: ?Sized> Debug for RedactedDebug<'_, T>
impl<T: ?Sized> Debug for RedactedDebug<'_, T>
Source§fn fmt(&self, formatter: &mut Formatter<'_>) -> Result
fn fmt(&self, formatter: &mut Formatter<'_>) -> Result
Writes the fixed redaction marker without formatting the wrapped value.
§Parameters
formatter: Destination formatter.
§Returns
The result of writing the marker to formatter.
§Errors
Returns std::fmt::Error when the formatter rejects the write.
Auto Trait Implementations§
impl<'a, T> Freeze for RedactedDebug<'a, T>where
T: ?Sized,
impl<'a, T> RefUnwindSafe for RedactedDebug<'a, T>where
T: RefUnwindSafe + ?Sized,
impl<'a, T> Send for RedactedDebug<'a, T>
impl<'a, T> Sync for RedactedDebug<'a, T>
impl<'a, T> Unpin for RedactedDebug<'a, T>where
T: ?Sized,
impl<'a, T> UnsafeUnpin for RedactedDebug<'a, T>where
T: ?Sized,
impl<'a, T> UnwindSafe for RedactedDebug<'a, T>where
T: RefUnwindSafe + ?Sized,
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