Skip to main content

RedactedTextComposer

Struct RedactedTextComposer 

Source
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

Source

pub fn literal(self, text: &'static str) -> Self

Appends trusted program-authored text.

Source

pub fn field<T>(self, field: &str, value: &T) -> Self
where T: Display + ?Sized,

Redacts and appends one scalar field.

Source

pub fn value<T>(self, value: &T) -> Self
where T: Redact + ?Sized,

Redacts and appends one domain value.

Source

pub fn argv<F>(self, configure: F) -> Self
where F: for<'session> FnOnce(&mut ArgvRedactionWriter<'session>),

Appends command-line text configured through the argv writer.

Source

pub fn env<F>(self, configure: F) -> Self
where F: for<'session> FnOnce(&mut EnvRedactionWriter<'session>),

Appends environment text configured through the environment writer.

Source

pub fn process<F>(self, configure: F) -> Self
where F: for<'session> FnOnce(&mut ProcessRedactionWriter<'session>),

Appends process text configured through the process writer.

Source

pub fn json<F>(self, configure: F) -> Self
where F: for<'session> FnOnce(&mut JsonRedactionWriter<'session>),

Appends JSON text configured through the JSON writer.

Source

pub fn http<F>(self, configure: F) -> Self
where F: for<'session> FnOnce(&mut HttpRedactionWriter<'session>),

Appends HTTP text configured through the HTTP writer.

Source

pub fn uri<F>(self, configure: F) -> Self
where F: for<'session> FnOnce(&mut UriRedactionWriter<'session>),

Appends URI text configured through the URI writer.

Source

pub fn finish(self) -> RedactionTextOutput

Consumes the composer and publishes its redacted text and summary.

Auto Trait Implementations§

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.