pub trait MatchParser: Send + Sync {
// Required method
fn find(&self, text: &str, offset: usize) -> Result<Vec<RawMatch>, String>;
}Expand description
A custom matcher: finds every hit for a rule in one scan unit (the whole file for global rules, a scope region for scoped rules).
This is the escape hatch beyond regexes — with the whole text in
hand, a parser can count duplicates, flag absent constructs, or
hand-roll any matching logic. Must be pure: same (text, offset),
same matches.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".