Skip to main content

ArgvRedactionWriter

Struct ArgvRedactionWriter 

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

A borrowed argv façade over one mutable diagnostic session.

§Type Parameters

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

§Examples

use std::ffi::OsStr;
use qubit_redact::{Redactor, Sensitivity};
use qubit_redact::formats::argv::ArgvItem;

let output = Redactor::standard().text_composer().argv(|argv| {
    argv.items([ArgvItem::sensitive(OsStr::new("raw-token"), Sensitivity::Secret)]);
}).finish();
assert!(!output.text().as_str().contains("raw-token"));

Implementations§

Source§

impl<'session> ArgvRedactionWriter<'session>

Source

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

Redacts items into the parent session’s aggregate output.

Plain items retain their values; use Self::heuristic_items to infer sensitivity from supported option syntax. Iterator advancement stops when shared structural admission fails or output is already closed.

§Type Parameters
  • 'items - Lifetime of borrowed argument values.
  • I - Finite source of explicitly classified argument items.
§Parameters
  • items - Arguments in their original command-line order.
§Returns

This writer for further operations in the same transaction.

Source

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

Redacts heuristic items into the parent session’s aggregate output.

Supported option syntax is interpreted only for plain items; explicit sensitivity is authoritative. This operation does not parse shell code.

§Type Parameters
  • 'items - Lifetime of borrowed argument values.
  • I - Finite source of arguments to classify and render.
§Parameters
  • items - Arguments in their original command-line order.
§Returns

This writer for further operations in the same transaction.

Auto Trait Implementations§

§

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

§

impl<'session> Freeze for ArgvRedactionWriter<'session>

§

impl<'session> RefUnwindSafe for ArgvRedactionWriter<'session>

§

impl<'session> Send for ArgvRedactionWriter<'session>

§

impl<'session> Sync for ArgvRedactionWriter<'session>

§

impl<'session> Unpin for ArgvRedactionWriter<'session>

§

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