Skip to main content

EnvRedactionWriter

Struct EnvRedactionWriter 

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

A borrowed environment façade over 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().env(|env| {
    env.pair("PASSWORD", "raw-password");
}).finish();
assert!(!output.text().as_str().contains("raw-password"));

Implementations§

Source§

impl<'session> EnvRedactionWriter<'session>

Source

pub fn pair(&mut self, name: &str, value: &str) -> &mut Self

Redacts one pair into the parent session’s aggregate output.

The name selects field policy; both name and value bytes consume the parent’s input allowance before rendering the assignment.

§Parameters
  • name - Environment variable name used for classification.
  • value - Borrowed value to redact or preserve under that policy.
§Returns

This writer for further operations in the same transaction.

Source

pub fn os_pairs<'items, I>(&mut self, pairs: I) -> &mut Self
where I: IntoIterator<Item = (&'items OsStr, &'items OsStr)>,

Redacts an environment list into the parent session’s aggregate output.

Iterator advancement is guarded by shared structural admission. Non-Unicode pairs use the format’s bounded fallback policy.

§Type Parameters
  • 'items - Lifetime of borrowed operating-system names and values.
  • I - Finite source of environment pairs.
§Parameters
  • pairs - Name/value pairs in the desired diagnostic order.
§Returns

This writer for further operations in the same transaction.

Auto Trait Implementations§

§

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

§

impl<'session> Freeze for EnvRedactionWriter<'session>

§

impl<'session> RefUnwindSafe for EnvRedactionWriter<'session>

§

impl<'session> Send for EnvRedactionWriter<'session>

§

impl<'session> Sync for EnvRedactionWriter<'session>

§

impl<'session> Unpin for EnvRedactionWriter<'session>

§

impl<'session> UnsafeUnpin for EnvRedactionWriter<'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.