pub struct ArgvRedactor { /* private fields */ }Expand description
Applies one immutable redaction policy to argument vectors.
Implementations§
Source§impl ArgvRedactor
impl ArgvRedactor
Sourcepub fn redact_items<'a, I>(&self, items: I) -> RedactedArgvwhere
I: IntoIterator<Item = ArgvItem<'a>>,
pub fn redact_items<'a, I>(&self, items: I) -> RedactedArgvwhere
I: IntoIterator<Item = ArgvItem<'a>>,
Redacts only values explicitly marked sensitive by their caller.
Plain items are rendered as ordinary argv values without guessing whether they are options, assignments, or option values. Non-UTF-8 sensitive items are masked from an opaque sentinel so their original bytes can never reach output.
§Type Parameters
'a- Lifetime of argument values borrowed by the iterator.I- Iterator source yielding borrowedArgvItemvalues.
§Parameters
items- Borrowed argv items with optional authoritative levels.
§Returns
A log-safe rendering in input order.
Sourcepub fn redact_heuristically<'a, I>(&self, items: I) -> RedactedArgvwhere
I: IntoIterator<Item = ArgvItem<'a>>,
pub fn redact_heuristically<'a, I>(&self, items: I) -> RedactedArgvwhere
I: IntoIterator<Item = ArgvItem<'a>>,
Redacts explicit sensitive values and heuristically classified plain values.
Explicit sensitivity always wins. Plain items recognize
--name value, --name=value, -name value, NAME=value, and
JVM-style -Dname=value properties. Compact options such as
-pSECRET and shell payload syntax are not inferred. Callers must mark
those values explicitly when they are sensitive. Because this is a
safety heuristic rather than a command-specific parser, an option
delimiter does not disable recognition in later wrapper or child-command
segments. A non-UTF-8 plain item is masked at Sensitivity::Secret
because it cannot be classified safely.
§Type Parameters
'a- Lifetime of argument values borrowed by the iterator.I- Iterator source yielding borrowedArgvItemvalues.
§Parameters
items- Borrowed argv items with optional authoritative levels.
§Returns
A log-safe rendering in input order.
Sourcepub fn redact_items_with_session<'a, I>(
&self,
items: I,
session: &RedactionSession<'_>,
) -> RedactedArgvwhere
I: IntoIterator<Item = ArgvItem<'a>>,
pub fn redact_items_with_session<'a, I>(
&self,
items: I,
session: &RedactionSession<'_>,
) -> RedactedArgvwhere
I: IntoIterator<Item = ArgvItem<'a>>,
Redacts explicit items while sharing cumulative input and output accounting with other diagnostic adapters.
Sourcepub fn redact_heuristically_with_session<'a, I>(
&self,
items: I,
session: &RedactionSession<'_>,
) -> RedactedArgvwhere
I: IntoIterator<Item = ArgvItem<'a>>,
pub fn redact_heuristically_with_session<'a, I>(
&self,
items: I,
session: &RedactionSession<'_>,
) -> RedactedArgvwhere
I: IntoIterator<Item = ArgvItem<'a>>,
Redacts explicit and heuristic items through a shared diagnostic session.
Trait Implementations§
Source§impl Clone for ArgvRedactor
impl Clone for ArgvRedactor
Source§fn clone(&self) -> ArgvRedactor
fn clone(&self) -> ArgvRedactor
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ArgvRedactor
impl Debug for ArgvRedactor
Source§impl Default for ArgvRedactor
impl Default for ArgvRedactor
Source§fn default() -> Self
fn default() -> Self
Creates an argv redactor from the current default policy snapshot.
§Returns
An argv redactor backed by Redactor::default.