Skip to main content

JsonRedactionWriter

Struct JsonRedactionWriter 

Source
pub struct JsonRedactionWriter<'session> { /* private fields */ }
Expand description

Feature-gated JSON operations sharing one mutable diagnostic session.

§Type Parameters

  • 'session - Borrow of the parent composer’s unpublished transaction.

§Examples

use qubit_redact::Redactor;

let output = Redactor::standard().text_composer().json(|json| {
    json.text(r#"{"password":"raw-secret","visible":7}"#);
}).finish();
assert!(!output.text().as_str().contains("raw-secret"));
assert!(output.text().as_str().contains("visible"));

Implementations§

Source§

impl<'session> JsonRedactionWriter<'session>

Source

pub fn text(&mut self, text: &str) -> &mut Self

Redacts JSON text into the parent session’s aggregate output.

§Parameters
  • text - One complete JSON document. Enabled redaction parses it once under the shared input and traversal limits.
§Returns

This writer for further operations; malformed or rejected input uses safe output and records its cause in the parent summary.

Source

pub fn value(&mut self, value: &Value) -> &mut Self

Redacts a borrowed parsed JSON value into the aggregate transaction.

§Parameters
  • value - Parsed JSON borrowed without cloning or modifying its tree.
§Returns

This writer after shared admission and rendering, or after recording a safe replacement when traversal cannot complete.

Auto Trait Implementations§

§

impl<'session> !UnwindSafe for JsonRedactionWriter<'session>

§

impl<'session> Freeze for JsonRedactionWriter<'session>

§

impl<'session> RefUnwindSafe for JsonRedactionWriter<'session>

§

impl<'session> Send for JsonRedactionWriter<'session>

§

impl<'session> Sync for JsonRedactionWriter<'session>

§

impl<'session> Unpin for JsonRedactionWriter<'session>

§

impl<'session> UnsafeUnpin for JsonRedactionWriter<'session>

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.