pub struct RedactedKeyedMap<'a, M: ?Sized, K: ?Sized = String, V: ?Sized = String> { /* private fields */ }Expand description
A lazy map view that classifies each value by its key before recursion.
Unknown and explicitly allowed keys delegate to the corresponding value’s
Redact implementation. Sensitive keys mask the complete value through
RedactValue.
§Type Parameters
'a- Lifetime of the borrowed map.M- Borrowed map-like container type.K- Runtime key type used for field classification.V- Value type recursively rendered through redaction.
Implementations§
Source§impl<'a, M: ?Sized, K: ?Sized, V: ?Sized> RedactedKeyedMap<'a, M, K, V>
impl<'a, M: ?Sized, K: ?Sized, V: ?Sized> RedactedKeyedMap<'a, M, K, V>
Sourcepub const fn new(map: &'a M, policy: RedactionPolicy) -> Self
pub const fn new(map: &'a M, policy: RedactionPolicy) -> Self
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<M: ?Sized, K: AsRef<str> + Debug + ?Sized, V: Redact + RedactValue + ?Sized> Debug for RedactedKeyedMap<'_, M, K, V>
impl<M: ?Sized, K: AsRef<str> + Debug + ?Sized, V: Redact + RedactValue + ?Sized> Debug for RedactedKeyedMap<'_, M, K, V>
Source§fn fmt(&self, formatter: &mut Formatter<'_>) -> Result
fn fmt(&self, formatter: &mut Formatter<'_>) -> Result
Formats each entry through its key-selected redaction behavior.
§Parameters
formatter- Destination debug formatter.
§Returns
The formatter result for the complete map.
§Errors
Returns fmt::Error when the destination rejects an entry or the
completed map.
Source§impl<M: ?Sized, K: AsRef<str> + Debug + ?Sized, V: Redact + RedactValue + ?Sized> Display for RedactedKeyedMap<'_, M, K, V>
impl<M: ?Sized, K: AsRef<str> + Debug + ?Sized, V: Redact + RedactValue + ?Sized> Display for RedactedKeyedMap<'_, M, K, V>
Source§fn fmt(&self, formatter: &mut Formatter<'_>) -> Result
fn fmt(&self, formatter: &mut Formatter<'_>) -> Result
Formats bounded compact redacted debug output and escapes it for plain-text logs.
§Parameters
formatter- Destination formatting context.
§Returns
The formatter result for the escaped redacted representation.
§Errors
Returns fmt::Error when the destination rejects the complete
log-safe representation.