Struct globset::Glob [−][src]
Glob represents a successfully parsed shell glob pattern.
It cannot be used directly to match file paths, but it can be converted to a regular expression string or a matcher.
Implementations
impl Glob
[src][−]
pub fn new(glob: &str) -> Result<Glob, Error>
[src][−]
Builds a new pattern with default options.
pub fn compile_matcher(&self) -> GlobMatcher
[src][−]
Returns a matcher for this pattern.
pub fn glob(&self) -> &str
[src][−]
Returns the original glob pattern used to build this pattern.
pub fn regex(&self) -> &str
[src][−]
Returns the regular expression string for this glob.
Note that regular expressions for globs are intended to be matched on
arbitrary bytes (&[u8]
) instead of Unicode strings (&str
). In
particular, globs are frequently used on file paths, where there is no
general guarantee that file paths are themselves valid UTF-8. As a
result, callers will need to ensure that they are using a regex API
that can match on arbitrary bytes. For example, the
regex
crate’s
Regex
API is not suitable for this since it matches on &str
, but its
bytes::Regex
API is suitable for this.
Trait Implementations
impl Clone for Glob
[src][+]
impl Debug for Glob
[src][+]
impl Display for Glob
[src][+]
impl Eq for Glob
[src]
impl FromStr for Glob
[src][+]
impl Hash for Glob
[src][+]
impl PartialEq<Glob> for Glob
[src][+]
impl StructuralEq for Glob
[src]
Auto Trait Implementations
impl RefUnwindSafe for Glob
impl Send for Glob
impl Sync for Glob
impl Unpin for Glob
impl UnwindSafe for Glob
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src][+]
T: Clone,
impl<T> ToString for T where
T: Display + ?Sized,
[src][+]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,