pub struct Glob { /* private fields */ }Expand description
A single glob pattern.
A Glob is constructed from a pattern string and can be compiled into a
GlobMatcher for matching against paths.
§Example
use glob_set::Glob;
let glob = Glob::new("*.rs").unwrap();
let matcher = glob.compile_matcher();
assert!(matcher.is_match("foo.rs"));Implementations§
Source§impl Glob
impl Glob
Sourcepub fn new(pattern: &str) -> Result<Self, Error>
pub fn new(pattern: &str) -> Result<Self, Error>
Create a new Glob from the given pattern.
§Errors
Returns an error if the pattern is structurally invalid (e.g. unclosed character class, unmatched braces, dangling escape).
Sourcepub fn compile_matcher(&self) -> GlobMatcher
pub fn compile_matcher(&self) -> GlobMatcher
Compile this glob into a matcher for matching paths.
Trait Implementations§
impl Eq for Glob
Auto Trait Implementations§
impl Freeze for Glob
impl RefUnwindSafe for Glob
impl Send for Glob
impl Sync for Glob
impl Unpin for Glob
impl UnsafeUnpin for Glob
impl UnwindSafe for Glob
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