pub struct Globster { /* private fields */ }Expand description
A set of glob patterns compiled to regexes for fast matching.
Patterns are categorised (extension/basename/fullpath), translated to
regexes, and aggregated into super-regexes of up to 99 alternatives each,
with each alternative wrapped in a capturing group so the matching pattern
can be recovered. See the Python breezy.globbing.Globster for the
rationale behind the categories and ordering.
Implementations§
Source§impl Globster
impl Globster
pub fn new<I, S>(patterns: I) -> Self
Sourcepub fn match_(&self, filename: &str) -> Result<Option<String>, InvalidPattern>
pub fn match_(&self, filename: &str) -> Result<Option<String>, InvalidPattern>
Return the original pattern that matches filename, or None.
Returns InvalidPattern if a pattern group failed to compile, listing
the individually-invalid patterns.
Auto Trait Implementations§
impl Freeze for Globster
impl RefUnwindSafe for Globster
impl Send for Globster
impl Sync for Globster
impl Unpin for Globster
impl UnsafeUnpin for Globster
impl UnwindSafe for Globster
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