[−][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.
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]
type Err = Error
The associated error which can be returned from parsing.
fn from_str(glob: &str) -> Result<Self, Self::Err>
[src]
impl Hash for Glob
[src]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
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,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,