pub struct ProcessRedactionWriter<'session> { /* private fields */ }Expand description
A borrowed process-command facade over one active redaction transaction.
This type owns no redactor, policy, result, or budget. Each operation delegates directly to the argv or environment namespace of the parent session, so process diagnostics participate in the same atomic output.
§Type Parameters
'session- Borrow of the parent composer’s unpublished transaction.
§Examples
use std::ffi::OsStr;
use qubit_redact::Redactor;
use qubit_redact::formats::argv::ArgvItem;
let output = Redactor::standard().text_composer().process(|process| {
process.command(
OsStr::new("client"),
[ArgvItem::plain(OsStr::new("--help"))],
[(OsStr::new("PASSWORD"), OsStr::new("raw-password"))],
);
}).finish();
assert!(!output.text().as_str().contains("raw-password"));Implementations§
Source§impl<'session> ProcessRedactionWriter<'session>
impl<'session> ProcessRedactionWriter<'session>
Sourcepub fn command<'arguments, 'variables, A, E>(
&mut self,
program: &'arguments OsStr,
arguments: A,
variables: E,
) -> &mut Selfwhere
A: IntoIterator<Item = ArgvItem<'arguments>>,
E: IntoIterator<Item = (&'variables OsStr, &'variables OsStr)>,
pub fn command<'arguments, 'variables, A, E>(
&mut self,
program: &'arguments OsStr,
arguments: A,
variables: E,
) -> &mut Selfwhere
A: IntoIterator<Item = ArgvItem<'arguments>>,
E: IntoIterator<Item = (&'variables OsStr, &'variables OsStr)>,
Redacts a complete process command into the parent aggregate output.
program is inserted as the first argv item. arguments therefore
must contain only the arguments following the executable. Each argument
preserves caller-supplied ArgvItem sensitivity. variables uses
borrowed operating-system name/value pairs and is rendered after argv.
No key or independently published result is created.
§Type Parameters
'arguments- Lifetime of borrowed argument values.A- Finite argument source.'variables- Lifetime of borrowed environment names and values.E- Finite environment source.
§Parameters
program- Executable path or program name.arguments- Arguments afterprogram.variables- Environment-variable pairs associated with the command.
§Returns
This facade for further aggregate process operations.
Sourcepub fn arguments<'arguments, A>(&mut self, arguments: A) -> &mut Selfwhere
A: IntoIterator<Item = ArgvItem<'arguments>>,
pub fn arguments<'arguments, A>(&mut self, arguments: A) -> &mut Selfwhere
A: IntoIterator<Item = ArgvItem<'arguments>>,
Redacts command-line arguments into the parent aggregate output.
Plain arguments use the argv namespace’s documented heuristic rules;
explicitly sensitive ArgvItem values are masked at their supplied
sensitivity. No key or standalone output is created.
§Type Parameters
'arguments- Lifetime of borrowed argument values.A- Finite argument source.
§Parameters
arguments- Borrowed argv items to render.
§Returns
This facade for further aggregate process operations.
Sourcepub fn variables<'variables, E>(&mut self, variables: E) -> &mut Self
pub fn variables<'variables, E>(&mut self, variables: E) -> &mut Self
Redacts process environment variables into the parent aggregate output.
Names and values remain borrowed until the environment namespace has processed them. No key or standalone output is created.
§Type Parameters
'variables- Lifetime of borrowed environment names and values.E- Finite environment source.
§Parameters
variables- Borrowed operating-system environment name/value pairs.
§Returns
This facade for further aggregate process operations.