Skip to main content

Scanner

Trait Scanner 

Source
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§

Source

fn scan(&self, input: &[u8]) -> Vec<MatchResult>

Scan a byte slice for all matching patterns.

Source

fn is_match(&self, input: &[u8]) -> bool

Check if ANY pattern matches (short-circuits on first match).

Source

fn pattern_count(&self) -> usize

Number of compiled patterns.

Implementors§