pub trait Scanner {
// Required methods
fn scan(&self, input: &[u8]) -> Vec<MatchResult>;
fn is_match(&self, input: &[u8]) -> bool;
fn pattern_count(&self) -> usize;
}Expand description
Trait for types that can scan inputs for multiple patterns.
Required Methods§
Sourcefn scan(&self, input: &[u8]) -> Vec<MatchResult>
fn scan(&self, input: &[u8]) -> Vec<MatchResult>
Scan a byte slice for all matching patterns.
Sourcefn is_match(&self, input: &[u8]) -> bool
fn is_match(&self, input: &[u8]) -> bool
Check if ANY pattern matches (short-circuits on first match).
Sourcefn pattern_count(&self) -> usize
fn pattern_count(&self) -> usize
Number of compiled patterns.