pub struct DebugDisplay<'value, T: ?Sized> { /* private fields */ }Expand description
Presents a borrowed fmt::Debug value through fmt::Display.
This adapter performs no eager allocation or formatting. Passing it to
crate::Redactor::redact_field or crate::RedactedTextComposer::field
lets an opaque high- or secret-sensitivity mask avoid observing the wrapped
value altogether. The wrapped Debug implementation runs only when the
selected policy needs the source representation, such as for pass-through,
disabled, low-, or medium-sensitivity rendering.
§Examples
use qubit_redact::{DebugDisplay, Redactor};
let values = vec!["first", "second"];
let output = Redactor::strict().redact_field("selection", &DebugDisplay::new(&values));
assert_eq!(output.text().as_str(), "<redacted>");Implementations§
Trait Implementations§
Source§impl<'value, T: Clone + ?Sized> Clone for DebugDisplay<'value, T>
impl<'value, T: Clone + ?Sized> Clone for DebugDisplay<'value, T>
Source§fn clone(&self) -> DebugDisplay<'value, T>
fn clone(&self) -> DebugDisplay<'value, T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'value, T: Copy + ?Sized> Copy for DebugDisplay<'value, T>
Auto Trait Implementations§
impl<'value, T> Freeze for DebugDisplay<'value, T>
impl<'value, T> RefUnwindSafe for DebugDisplay<'value, T>
impl<'value, T> Send for DebugDisplay<'value, T>
impl<'value, T> Sync for DebugDisplay<'value, T>
impl<'value, T> Unpin for DebugDisplay<'value, T>
impl<'value, T> UnsafeUnpin for DebugDisplay<'value, T>
impl<'value, T> UnwindSafe for DebugDisplay<'value, T>
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