pub struct RedactionProcessor { /* private fields */ }Expand description
Returns redacted copies of records: sensitive attribute names (recursively) get the replacement, and every pattern is replaced in the body and in string attribute values.
Implementations§
Source§impl RedactionProcessor
impl RedactionProcessor
Sourcepub fn new<K, S>(keys: K, patterns: Vec<Regex>) -> Self
pub fn new<K, S>(keys: K, patterns: Vec<Regex>) -> Self
Processor with the given keys and patterns and the [REDACTED] replacement.
Sourcepub fn with_extra_keys<S: AsRef<str>>(
self,
keys: impl IntoIterator<Item = S>,
) -> Self
pub fn with_extra_keys<S: AsRef<str>>( self, keys: impl IntoIterator<Item = S>, ) -> Self
Adds more key fragments to the defaults.
Sourcepub fn with_pattern(self, pattern: Regex) -> Self
pub fn with_pattern(self, pattern: Regex) -> Self
Adds a pattern applied to the body and string values.
Sourcepub fn with_replacement(self, replacement: impl Into<String>) -> Self
pub fn with_replacement(self, replacement: impl Into<String>) -> Self
Changes the replacement text.
Sourcepub fn is_sensitive_key(&self, name: &str) -> bool
pub fn is_sensitive_key(&self, name: &str) -> bool
Whether an attribute name is sensitive.
Trait Implementations§
Source§impl Clone for RedactionProcessor
impl Clone for RedactionProcessor
Source§impl Debug for RedactionProcessor
impl Debug for RedactionProcessor
Auto Trait Implementations§
impl Forget for RedactionProcessor
impl Freeze for RedactionProcessor
impl Move for RedactionProcessor
impl RefUnwindSafe for RedactionProcessor
impl Send for RedactionProcessor
impl Sync for RedactionProcessor
impl Unpin for RedactionProcessor
impl UnsafeUnpin for RedactionProcessor
impl UnwindSafe for RedactionProcessor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more