pub struct SecretDetector { /* private fields */ }Implementations§
Source§impl SecretDetector
impl SecretDetector
Sourcepub fn new(data: &Value) -> Result<Self, String>
pub fn new(data: &Value) -> Result<Self, String>
The detector for a secret-patterns.json document.
Sourcepub fn shipped() -> &'static SecretDetector
pub fn shipped() -> &'static SecretDetector
The detector for the shipped rules (rlm/secret-patterns.json), built once.
Sourcepub fn scan(&self, text: &str, mask: bool) -> Vec<SecretFinding>
pub fn scan(&self, text: &str, mask: bool) -> Vec<SecretFinding>
Non-overlapping findings in text, in order; mask selects the masking scope, else the scan scope.
Sourcepub fn redact_counted(&self, text: &str) -> (String, usize)
pub fn redact_counted(&self, text: &str) -> (String, usize)
text with every masking finding replaced by [REDACTED:<kind>], and how many were replaced.
Auto Trait Implementations§
impl Forget for SecretDetector
impl Freeze for SecretDetector
impl Move for SecretDetector
impl RefUnwindSafe for SecretDetector
impl Send for SecretDetector
impl Sync for SecretDetector
impl Unpin for SecretDetector
impl UnsafeUnpin for SecretDetector
impl UnwindSafe for SecretDetector
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