[−][src]Struct globset::Glob
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.
Methods
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 Eq for Glob
[src]
impl PartialEq<Glob> for Glob
[src]
fn eq(&self, other: &Glob) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl Clone for Glob
[src]
fn clone(&self) -> Glob
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Display for Glob
[src]
impl Debug for Glob
[src]
impl Hash for Glob
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into 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 for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,