Skip to main content

RedactedKeyedMap

Struct RedactedKeyedMap 

Source
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>

Source

pub const fn new(map: &'a M, policy: RedactionPolicy) -> Self

Creates a lazy recursive keyed map view without traversing the map.

§Parameters
  • map - Map-like container to borrow.
  • policy - Complete policy snapshot owned by the map view.
§Returns

A lazy borrowed map view that shares its policy across all entries.

Source

pub const fn with_output_limit( self, limit: LogOutputLimit, ) -> BoundedRedactedDisplay<Self>

Converts this view into a byte-bounded, log-safe display adapter.

§Parameters
  • limit - Maximum rendered bytes including any truncation marker.
§Returns

A bounded formatting adapter that owns this recursive keyed map view.

Source

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>
where for<'entry> &'entry M: IntoIterator<Item = (&'entry K, &'entry V)>,

Source§

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>
where for<'entry> &'entry M: IntoIterator<Item = (&'entry K, &'entry V)>,

Source§

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.

Auto Trait Implementations§

§

impl<'a, M, K, V> Freeze for RedactedKeyedMap<'a, M, K, V>
where M: ?Sized, K: ?Sized, V: ?Sized,

§

impl<'a, M, K, V> RefUnwindSafe for RedactedKeyedMap<'a, M, K, V>
where M: RefUnwindSafe + ?Sized, K: ?Sized, V: ?Sized,

§

impl<'a, M, K, V> Send for RedactedKeyedMap<'a, M, K, V>
where M: Sync + ?Sized, K: ?Sized, V: ?Sized,

§

impl<'a, M, K, V> Sync for RedactedKeyedMap<'a, M, K, V>
where M: Sync + ?Sized, K: ?Sized, V: ?Sized,

§

impl<'a, M, K, V> Unpin for RedactedKeyedMap<'a, M, K, V>
where M: ?Sized, K: ?Sized, V: ?Sized,

§

impl<'a, M, K, V> UnsafeUnpin for RedactedKeyedMap<'a, M, K, V>
where M: ?Sized, K: ?Sized, V: ?Sized,

§

impl<'a, M, K, V> UnwindSafe for RedactedKeyedMap<'a, M, K, V>
where M: RefUnwindSafe + ?Sized, K: ?Sized, V: ?Sized,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.