pub struct RedactedTextComposer { /* private fields */ }Expand description
Builds one ordered, redacted text value through consuming chained calls.
§Examples
use qubit_redact::Redactor;
let output = Redactor::strict()
.text_composer()
.literal("password=")
.field("password", "raw-secret")
.finish();
assert!(!output.text().as_str().contains("raw-secret"));Implementations§
Source§impl RedactedTextComposer
impl RedactedTextComposer
Sourcepub fn field<T>(self, field: &str, value: &T) -> Self
pub fn field<T>(self, field: &str, value: &T) -> Self
Redacts and appends one scalar field.
§Type Parameters
T: Lazily evaluated scalar formatter.
§Parameters
field: Raw scalar key used for admission and policy classification.value: Scalar formatted only when admission and masking require it.
§Returns
This composer after recording the scalar result and accounting.
Sourcepub fn argv<F>(self, configure: F) -> Selfwhere
F: for<'session> FnOnce(&mut ArgvRedactionWriter<'session>),
pub fn argv<F>(self, configure: F) -> Selfwhere
F: for<'session> FnOnce(&mut ArgvRedactionWriter<'session>),
Appends command-line text configured through the argv writer.
§Type Parameters
F: Callback whose writer borrow cannot escape the call.
§Parameters
configure: One-shot callback using the format writer and this transaction’s remaining budget.
§Returns
This composer retaining the updated output and execution summary.
Sourcepub fn env<F>(self, configure: F) -> Selfwhere
F: for<'session> FnOnce(&mut EnvRedactionWriter<'session>),
pub fn env<F>(self, configure: F) -> Selfwhere
F: for<'session> FnOnce(&mut EnvRedactionWriter<'session>),
Appends environment text configured through the environment writer.
§Type Parameters
F: Callback whose writer borrow cannot escape the call.
§Parameters
configure: One-shot callback using the format writer and this transaction’s remaining budget.
§Returns
This composer retaining the updated output and execution summary.
Sourcepub fn process<F>(self, configure: F) -> Selfwhere
F: for<'session> FnOnce(&mut ProcessRedactionWriter<'session>),
pub fn process<F>(self, configure: F) -> Selfwhere
F: for<'session> FnOnce(&mut ProcessRedactionWriter<'session>),
Appends process text configured through the process writer.
§Type Parameters
F: Callback whose writer borrow cannot escape the call.
§Parameters
configure: One-shot callback using the format writer and this transaction’s remaining budget.
§Returns
This composer retaining the updated output and execution summary.
Sourcepub fn json<F>(self, configure: F) -> Selfwhere
F: for<'session> FnOnce(&mut JsonRedactionWriter<'session>),
pub fn json<F>(self, configure: F) -> Selfwhere
F: for<'session> FnOnce(&mut JsonRedactionWriter<'session>),
Appends JSON text configured through the JSON writer.
§Type Parameters
F: Callback whose writer borrow cannot escape the call.
§Parameters
configure: One-shot callback using the format writer and this transaction’s remaining budget.
§Returns
This composer retaining the updated output and execution summary.
Sourcepub fn http<F>(self, configure: F) -> Selfwhere
F: for<'session> FnOnce(&mut HttpRedactionWriter<'session>),
pub fn http<F>(self, configure: F) -> Selfwhere
F: for<'session> FnOnce(&mut HttpRedactionWriter<'session>),
Appends HTTP text configured through the HTTP writer.
§Type Parameters
F: Callback whose writer borrow cannot escape the call.
§Parameters
configure: One-shot callback using the format writer and this transaction’s remaining budget.
§Returns
This composer retaining the updated output and execution summary.
Sourcepub fn uri<F>(self, configure: F) -> Selfwhere
F: for<'session> FnOnce(&mut UriRedactionWriter<'session>),
pub fn uri<F>(self, configure: F) -> Selfwhere
F: for<'session> FnOnce(&mut UriRedactionWriter<'session>),
Appends URI text configured through the URI writer.
§Type Parameters
F: Callback whose writer borrow cannot escape the call.
§Parameters
configure: One-shot callback using the format writer and this transaction’s remaining budget.
§Returns
This composer retaining the updated output and execution summary.
Sourcepub fn finish(self) -> RedactionTextOutput
pub fn finish(self) -> RedactionTextOutput
Consumes the composer and publishes its redacted text and summary.
§Returns
The completed text and its actual completion, reasons, and resource accounting.