Struct OptimizedPatternMatcher
pub struct OptimizedPatternMatcher { /* private fields */ }Expand description
Optimized pattern matcher with memoization and BFS
Implementations§
§impl OptimizedPatternMatcher
impl OptimizedPatternMatcher
pub fn new() -> OptimizedPatternMatcher
pub fn new() -> OptimizedPatternMatcher
Create a new optimized pattern matcher
pub fn with_cache_size(max_cache_size: usize) -> OptimizedPatternMatcher
pub fn with_cache_size(max_cache_size: usize) -> OptimizedPatternMatcher
Create a new optimized pattern matcher with custom cache size
pub fn add_pattern(&mut self, pattern: &str)
pub fn add_pattern(&mut self, pattern: &str)
Add a pattern to the matcher
pub fn remove_pattern(&mut self, pattern: &str) -> bool
pub fn remove_pattern(&mut self, pattern: &str) -> bool
Remove a pattern from the matcher
pub fn find_matching_patterns(&mut self, topic: &str) -> Vec<String>
pub fn find_matching_patterns(&mut self, topic: &str) -> Vec<String>
Find all patterns that match a given topic with memoization
pub fn has_match(&mut self, topic: &str) -> bool
pub fn has_match(&mut self, topic: &str) -> bool
Check if any pattern matches the given topic with early termination
pub fn pattern_count(&self) -> usize
pub fn pattern_count(&self) -> usize
Get the number of registered patterns
pub fn cache_statistics(&self) -> CacheStatistics
pub fn cache_statistics(&self) -> CacheStatistics
Get cache statistics
pub fn clear(&mut self)
pub fn clear(&mut self)
Clear all patterns
pub fn clear_cache(&mut self)
pub fn clear_cache(&mut self)
Clear only the cache (keep patterns)
Trait Implementations§
§impl Debug for OptimizedPatternMatcher
impl Debug for OptimizedPatternMatcher
§impl Default for OptimizedPatternMatcher
impl Default for OptimizedPatternMatcher
§fn default() -> OptimizedPatternMatcher
fn default() -> OptimizedPatternMatcher
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for OptimizedPatternMatcher
impl RefUnwindSafe for OptimizedPatternMatcher
impl Send for OptimizedPatternMatcher
impl Sync for OptimizedPatternMatcher
impl Unpin for OptimizedPatternMatcher
impl UnwindSafe for OptimizedPatternMatcher
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