pub struct Redacted<'a, T: ?Sized> { /* private fields */ }Expand description
A lazy non-destructive redacted view of a domain object.
The view borrows the original object and owns a cheap clone of the complete policy. Creating it does not inspect, clone, or modify object fields.
§Type Parameters
'a- Lifetime of the borrowed domain object.T- Domain-object type rendered or serialized through redaction.
Implementations§
Source§impl<'a, T: ?Sized> Redacted<'a, T>
impl<'a, T: ?Sized> Redacted<'a, T>
Sourcepub const fn with_output_limit(
self,
limit: LogOutputLimit,
) -> BoundedRedactedDisplay<Self>
pub const fn with_output_limit( self, limit: LogOutputLimit, ) -> BoundedRedactedDisplay<Self>
Sourcepub fn with_policy_output_limit(self) -> BoundedRedactedDisplay<Self>
pub fn with_policy_output_limit(self) -> BoundedRedactedDisplay<Self>
Converts this view into a byte-bounded display adapter using its policy.
§Returns
A formatting adapter bounded by this view’s diagnostic output budget.
Trait Implementations§
Source§impl<T: Redact + ?Sized> Debug for Redacted<'_, T>
impl<T: Redact + ?Sized> Debug for Redacted<'_, T>
Source§fn fmt(&self, formatter: &mut Formatter<'_>) -> Result
fn fmt(&self, formatter: &mut Formatter<'_>) -> Result
Writes the object’s redacted representation while preserving formatter flags such as alternate pretty formatting.
§Parameters
formatter- Destination formatting context whose flags are passed to the object’s redaction hook.
§Returns
The formatter result for the complete redacted representation.
§Errors
Returns fmt::Error when the object cannot write its complete
redacted representation.
Source§impl<T: Redact + ?Sized> Display for Redacted<'_, T>
impl<T: Redact + ?Sized> Display for Redacted<'_, T>
Source§fn fmt(&self, formatter: &mut Formatter<'_>) -> Result
fn fmt(&self, formatter: &mut Formatter<'_>) -> Result
Writes a bounded compact redacted debug representation escaped for logs.
Redacted debug output is escaped directly into the destination without
constructing an intermediate String. This implementation never
calls the original object’s Display.
§Parameters
formatter- Destination formatting context.
§Returns
The formatter result for the escaped redacted representation.
§Errors
Returns fmt::Error when the destination cannot accept the complete
log-safe representation.