pub struct Redaction { /* private fields */ }
Expand description

Define redact settings

Implementations

Create a Redaction Methods

Example
use redact_engine::Redaction;
Redaction::custom("CUSTOM_HIDDEN_TEXT")

Create a Redaction with redact placeholder text.

Arguments
  • redact_placeholder - placeholder redaction
Example
use redact_engine::Redaction;
Redaction::custom("[HIDDEN_VALUE]")

redact exact string match

Arguments
  • value - The redaction value
Example
use redact_engine::Redaction;
let text = "foo,bar";
Redaction::new().add_value("foo");
Errors

when the value could not converted to a regex

redact exact string match from list of strings

Arguments
  • values - List of redaction value
Example
use redact_engine::Redaction;
let text = "foo,bar,baz";
Redaction::new().add_values(vec!["foo", "baz"]);
Errors

when the value could not converted to a regex

Add a Pattern to the redaction list

Arguments
Example
use redact_engine::{Redaction, Pattern};
use regex::Regex;
let text = "foo,bar";
let pattern = Pattern {
   test: Regex::new("(bar)").unwrap(),
   group: 1,
};

Redaction::new().add_pattern(pattern);

Add list if Pattern to the redaction list

Arguments
  • patterns - List of redact Pattern
Example
use redact_engine::{Redaction, Pattern};
use regex::Regex;
let text = "foo,bar";
let pattern = Pattern {
   test: Regex::new("(bar)").unwrap(),
   group: 1,
};

Redaction::new().add_patterns(vec![pattern]);

Redact from string

Redact text from reader

Errors
  • When file not exists.
  • Could not open reader.

Trait Implementations

Create a Redaction Methods

Example
use redact_engine::Redaction;
Redaction::default()

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.