Skip to main content

RedactedJson

Struct RedactedJson 

Source
pub struct RedactedJson<'value, 'policy> { /* private fields */ }
Expand description

A borrowed JSON value rendered with policy-aware object-key redaction.

Implementations§

Source§

impl<'value, 'policy> RedactedJson<'value, 'policy>

Source

pub const fn new(value: &'value Value, policy: &'policy RedactionPolicy) -> Self

Creates a lazy redacted view over one parsed JSON value.

§Parameters
  • value - Parsed JSON borrowed without cloning.
  • policy - Immutable policy used to classify object keys.
§Returns

A borrowed JSON redaction view.

Trait Implementations§

Source§

impl Debug for RedactedJson<'_, '_>

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats nested objects and arrays while masking policy-selected values.

§Parameters
  • formatter - Destination formatting context.
§Returns

The formatter result for the redacted JSON representation.

§Errors

Returns a formatting error when the destination rejects output.

Source§

impl Serialize for RedactedJson<'_, '_>

Available on crate feature serde only.
Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serializes a bounded redacted view while retaining safe JSON shapes.

§Type Parameters
  • S - Destination serializer type.
§Parameters
  • serializer - Destination serde serializer.
§Returns

The destination serializer result.

§Errors

Returns the destination serializer error unchanged.

Auto Trait Implementations§

§

impl<'value, 'policy> Freeze for RedactedJson<'value, 'policy>

§

impl<'value, 'policy> RefUnwindSafe for RedactedJson<'value, 'policy>

§

impl<'value, 'policy> Send for RedactedJson<'value, 'policy>

§

impl<'value, 'policy> Sync for RedactedJson<'value, 'policy>

§

impl<'value, 'policy> Unpin for RedactedJson<'value, 'policy>

§

impl<'value, 'policy> UnsafeUnpin for RedactedJson<'value, 'policy>

§

impl<'value, 'policy> UnwindSafe for RedactedJson<'value, 'policy>

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, 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.