pub trait SensitivityScanner: Send + Sync {
// Required method
fn scan(&self, text: &str) -> Option<String>;
}Expand description
Trait for detecting sensitive content in text.
Implementors define their own patterns and detection logic. The protocol requires only that detected content is categorized by a human-readable name (e.g., “API Key”, “IBAN”, “Bank PIN”).
§Example
use sigil_protocol::SensitivityScanner;
struct RegexScanner { /* ... */ }
impl SensitivityScanner for RegexScanner {
fn scan(&self, text: &str) -> Option<String> {
if text.contains("sk-") {
Some("API Key".to_string())
} else {
None
}
}
}