pub struct PrivacyClassifier { /* private fields */ }Expand description
Privacy classifier with pre-compiled regex rules.
Wraps a3s_common::privacy::RegexClassifier with the a3s-code-specific API.
Implementations§
Source§impl PrivacyClassifier
impl PrivacyClassifier
Sourcepub fn new(rules: &[ClassificationRule]) -> Self
pub fn new(rules: &[ClassificationRule]) -> Self
Create a new classifier from classification rules
Sourcepub fn classify(&self, text: &str) -> ClassificationResult
pub fn classify(&self, text: &str) -> ClassificationResult
Classify text and return all matches
Sourcepub fn redact(&self, text: &str, strategy: RedactionStrategy) -> String
pub fn redact(&self, text: &str, strategy: RedactionStrategy) -> String
Redact all matches in text using the given strategy
Sourcepub fn contains_sensitive(&self, text: &str) -> bool
pub fn contains_sensitive(&self, text: &str) -> bool
Quick check: does the text contain any sensitive data?
Auto Trait Implementations§
impl Freeze for PrivacyClassifier
impl RefUnwindSafe for PrivacyClassifier
impl Send for PrivacyClassifier
impl Sync for PrivacyClassifier
impl Unpin for PrivacyClassifier
impl UnsafeUnpin for PrivacyClassifier
impl UnwindSafe for PrivacyClassifier
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