Struct PatternMatcher
pub struct PatternMatcher { /* private fields */ }Expand description
Pattern matcher that pre-compiles all patterns for efficient matching
Implementations§
§impl PatternMatcher
impl PatternMatcher
pub fn new() -> PatternMatcher
pub fn new() -> PatternMatcher
Create a new pattern matcher
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(&self, topic: &str) -> Vec<&str>
pub fn find_matching_patterns(&self, topic: &str) -> Vec<&str>
Find all patterns that match a given topic
pub fn pattern_count(&self) -> usize
pub fn pattern_count(&self) -> usize
Get the number of registered patterns
pub fn clear(&mut self)
pub fn clear(&mut self)
Clear all patterns
Trait Implementations§
§impl Debug for PatternMatcher
impl Debug for PatternMatcher
§impl Default for PatternMatcher
impl Default for PatternMatcher
§fn default() -> PatternMatcher
fn default() -> PatternMatcher
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PatternMatcher
impl RefUnwindSafe for PatternMatcher
impl Send for PatternMatcher
impl Sync for PatternMatcher
impl Unpin for PatternMatcher
impl UnwindSafe for PatternMatcher
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