pub enum PatternMatcher {
Exact(String),
Glob(GlobPattern),
Regex(RegexPattern),
All,
}Expand description
Pattern matching strategy for task routing
Variants§
Exact(String)
Exact name match
Glob(GlobPattern)
Glob pattern (supports * and ?)
Regex(RegexPattern)
Regular expression pattern
All
Match all tasks
Implementations§
Source§impl PatternMatcher
impl PatternMatcher
Sourcepub fn glob(pattern: impl Into<String>) -> Self
pub fn glob(pattern: impl Into<String>) -> Self
Create a glob pattern matcher
Supports:
*matches any sequence of characters?matches any single character
§Example
use celers_core::router::PatternMatcher;
let matcher = PatternMatcher::glob("tasks.*");
assert!(matcher.matches("tasks.add"));
assert!(matcher.matches("tasks.multiply"));
assert!(!matcher.matches("other.task"));Trait Implementations§
Source§impl Clone for PatternMatcher
impl Clone for PatternMatcher
Source§fn clone(&self) -> PatternMatcher
fn clone(&self) -> PatternMatcher
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto 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