pub struct RedactedKeyedValue<'value, 'policy, T: ?Sized> { /* private fields */ }Expand description
A borrowed value rendered according to a separate field key.
The key is used only to select a policy rule. The view itself renders or serializes the value, and borrows an immutable policy snapshot.
§Type Parameters
'value- Lifetime of the borrowed key and value.'policy- Lifetime of the borrowed policy snapshot.T- Value type rendered or serialized through redaction.
Implementations§
Source§impl<'value, 'policy, T: ?Sized> RedactedKeyedValue<'value, 'policy, T>
impl<'value, 'policy, T: ?Sized> RedactedKeyedValue<'value, 'policy, T>
Sourcepub const fn new(
key: &'value str,
value: &'value T,
policy: &'policy RedactionPolicy,
) -> Self
pub const fn new( key: &'value str, value: &'value T, policy: &'policy RedactionPolicy, ) -> Self
Trait Implementations§
Source§impl<T: Redact + RedactValue + ?Sized> Debug for RedactedKeyedValue<'_, '_, T>
impl<T: Redact + RedactValue + ?Sized> Debug for RedactedKeyedValue<'_, '_, T>
Source§fn fmt(&self, formatter: &mut Formatter<'_>) -> Result
fn fmt(&self, formatter: &mut Formatter<'_>) -> Result
Formats the value through its selected field classification.
§Parameters
formatter- Destination formatter whose flags are preserved.
§Returns
The complete redacted debug result.
§Errors
Returns fmt::Error when the destination formatter cannot accept the
complete representation.
Source§impl<T: Redact + RedactValue + ?Sized> Display for RedactedKeyedValue<'_, '_, T>
impl<T: Redact + RedactValue + ?Sized> Display for RedactedKeyedValue<'_, '_, T>
Source§fn fmt(&self, formatter: &mut Formatter<'_>) -> Result
fn fmt(&self, formatter: &mut Formatter<'_>) -> Result
Formats the selected redacted representation for a bounded plain-text log.
§Parameters
formatter- Destination plain-text log boundary.
§Returns
The complete escaped redacted representation.
§Errors
Returns fmt::Error when the destination formatter cannot accept the
complete escaped representation.
Source§impl<T: RedactValue + RedactSerialize + ?Sized> Serialize for RedactedKeyedValue<'_, '_, T>
Available on crate feature serde only.
impl<T: RedactValue + RedactSerialize + ?Sized> Serialize for RedactedKeyedValue<'_, '_, T>
Available on crate feature
serde only.Auto Trait Implementations§
impl<'value, 'policy, T> Freeze for RedactedKeyedValue<'value, 'policy, T>where
T: ?Sized,
impl<'value, 'policy, T> RefUnwindSafe for RedactedKeyedValue<'value, 'policy, T>where
T: RefUnwindSafe + ?Sized,
impl<'value, 'policy, T> Send for RedactedKeyedValue<'value, 'policy, T>
impl<'value, 'policy, T> Sync for RedactedKeyedValue<'value, 'policy, T>
impl<'value, 'policy, T> Unpin for RedactedKeyedValue<'value, 'policy, T>where
T: ?Sized,
impl<'value, 'policy, T> UnsafeUnpin for RedactedKeyedValue<'value, 'policy, T>where
T: ?Sized,
impl<'value, 'policy, T> UnwindSafe for RedactedKeyedValue<'value, 'policy, 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