pub enum Filter {
Any,
Exact(String),
Prefix(String),
Suffix(String),
Wildcard {
prefix: String,
suffix: String,
},
}
Variants§
Implementations§
Source§impl Filter
impl Filter
pub fn new(pattern: &str) -> Self
Sourcepub fn matches<'a>(&self, input: &'a str) -> Option<FilterMatch<'a>>
pub fn matches<'a>(&self, input: &'a str) -> Option<FilterMatch<'a>>
Check if the input matches the filter.
Returns a FilterMatch that contains both the captured wildcard and the full match.
pub fn reconstruct(&self, capture: &str) -> String
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Filter
impl RefUnwindSafe for Filter
impl Send for Filter
impl Sync for Filter
impl Unpin for Filter
impl UnwindSafe for Filter
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