pub struct MultiBitapMatcher { /* private fields */ }Expand description
Multi-pattern Bitap matcher for searching multiple patterns in a single text pass.
This is more efficient than running N separate Bitap searches because:
- Text is scanned only once
- Character decoding is done once per character
- Better cache locality
Implementations§
Source§impl MultiBitapMatcher
impl MultiBitapMatcher
Sourcepub fn new(
patterns: &[&str],
limits: &EditLimits,
case_insensitive: bool,
) -> Option<Self>
pub fn new( patterns: &[&str], limits: &EditLimits, case_insensitive: bool, ) -> Option<Self>
Create a new multi-pattern matcher.
Returns None if any pattern is too long or empty.
Sourcepub fn find_all(&self, text: &str, threshold: f32) -> Vec<MultiPatternMatch>
pub fn find_all(&self, text: &str, threshold: f32) -> Vec<MultiPatternMatch>
Find all matches for all patterns in a single text pass.
Returns matches with their pattern indices.
Sourcepub fn pattern_count(&self) -> usize
pub fn pattern_count(&self) -> usize
Get the number of patterns.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MultiBitapMatcher
impl RefUnwindSafe for MultiBitapMatcher
impl Send for MultiBitapMatcher
impl Sync for MultiBitapMatcher
impl Unpin for MultiBitapMatcher
impl UnsafeUnpin for MultiBitapMatcher
impl UnwindSafe for MultiBitapMatcher
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