pub struct DefaultStringAnalyzer { /* private fields */ }
Expand description
Default implementation of StringAnalyzer
Implementations§
Source§impl DefaultStringAnalyzer
impl DefaultStringAnalyzer
Sourcepub fn with_entropy_threshold(self, threshold: f64) -> Self
pub fn with_entropy_threshold(self, threshold: f64) -> Self
Set the entropy threshold for suspicious detection
Sourcepub fn with_patterns(self, patterns: Vec<Pattern>) -> Self
pub fn with_patterns(self, patterns: Vec<Pattern>) -> Self
Add patterns to the analyzer
Trait Implementations§
Source§impl Default for DefaultStringAnalyzer
impl Default for DefaultStringAnalyzer
Source§impl StringAnalyzer for DefaultStringAnalyzer
impl StringAnalyzer for DefaultStringAnalyzer
Source§fn analyze(&self, value: &str) -> StringAnalysis
fn analyze(&self, value: &str) -> StringAnalysis
Analyze a string and return analysis results
Source§fn calculate_entropy(&self, s: &str) -> f64
fn calculate_entropy(&self, s: &str) -> f64
Calculate entropy of a string
Source§fn get_patterns(&self) -> &[Pattern]
fn get_patterns(&self) -> &[Pattern]
Get the patterns used by this analyzer
Source§fn add_pattern(&mut self, pattern: Pattern) -> AnalysisResult<()>
fn add_pattern(&mut self, pattern: Pattern) -> AnalysisResult<()>
Add a custom pattern
Source§fn is_suspicious(&self, value: &str) -> bool
fn is_suspicious(&self, value: &str) -> bool
Check if a string is suspicious
Auto Trait Implementations§
impl Freeze for DefaultStringAnalyzer
impl RefUnwindSafe for DefaultStringAnalyzer
impl Send for DefaultStringAnalyzer
impl Sync for DefaultStringAnalyzer
impl Unpin for DefaultStringAnalyzer
impl UnwindSafe for DefaultStringAnalyzer
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