pub trait PatternMatcher: Send + Sync {
// Required methods
fn initialize(&mut self, patterns: &[ToolPattern]) -> Result<()>;
fn find_matches<'a>(&self, text: &'a str) -> Vec<ToolMatch<'a>>;
fn matcher_type(&self) -> &'static str;
}Expand description
Trait for pattern matching implementations
Required Methods§
Sourcefn initialize(&mut self, patterns: &[ToolPattern]) -> Result<()>
fn initialize(&mut self, patterns: &[ToolPattern]) -> Result<()>
Initialize the matcher with tool patterns
§Errors
Returns an error if the automaton cannot be built from the patterns
Sourcefn find_matches<'a>(&self, text: &'a str) -> Vec<ToolMatch<'a>>
fn find_matches<'a>(&self, text: &'a str) -> Vec<ToolMatch<'a>>
Find all tool matches in the given text
Returns matches ordered by position (leftmost-longest)
Sourcefn matcher_type(&self) -> &'static str
fn matcher_type(&self) -> &'static str
Get the matcher type identifier