pub struct RedactionRule {
pub name: String,
pub pattern: Regex,
pub replacement: String,
}Expand description
Represents a single rule used to redact a secret.
- WHAT – The name of the rule (e.g. “OpenAI API Key”), the compiled regular‑expression pattern that matches the secret, and the replacement string that will be inserted.
- HOW – The
patternis aRegexthat is applied to an input string. When a match is found thereplacementis inserted usingreplace_all. - WHY – Decoupling the rule definition from the redaction logic makes the sanitizer extensible; new patterns can be added without changing the core implementation.
Fields§
§name: StringHuman‑readable name for the rule.
pattern: RegexCompiled regular expression that matches the secret.
replacement: StringText that will replace the matched secret.
Auto Trait Implementations§
impl Freeze for RedactionRule
impl RefUnwindSafe for RedactionRule
impl Send for RedactionRule
impl Sync for RedactionRule
impl Unpin for RedactionRule
impl UnwindSafe for RedactionRule
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