[][src]Struct globset::Glob

pub struct Glob { /* fields omitted */ }

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.

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.