[][src]Enum ignore::Match

pub enum Match<T> {
    None,
    Ignore(T),
    Whitelist(T),
}

The result of a glob match.

The type parameter T typically refers to a type that provides more information about a particular match. For example, it might identify the specific gitignore file and the specific glob pattern that caused the match.

Variants

None

The path didn't match any glob.

Ignore(T)

The highest precedent glob matched indicates the path should be ignored.

Whitelist(T)

The highest precedent glob matched indicates the path should be whitelisted.

Methods

impl<T> Match<T>[src]

pub fn is_none(&self) -> bool[src]

Returns true if the match result didn't match any globs.

pub fn is_ignore(&self) -> bool[src]

Returns true if the match result implies the path should be ignored.

pub fn is_whitelist(&self) -> bool[src]

Returns true if the match result implies the path should be whitelisted.

pub fn invert(self) -> Match<T>[src]

Inverts the match so that Ignore becomes Whitelist and Whitelist becomes Ignore. A non-match remains the same.

pub fn inner(&self) -> Option<&T>[src]

Return the value inside this match if it exists.

pub fn map<U, F: FnOnce(T) -> U>(self, f: F) -> Match<U>[src]

Apply the given function to the value inside this match.

If the match has no value, then return the match unchanged.

pub fn or(self, other: Self) -> Self[src]

Return the match if it is not none. Otherwise, return other.

Trait Implementations

impl<T: Clone> Clone for Match<T>[src]

impl<T: Debug> Debug for Match<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Match<T> where
    T: RefUnwindSafe

impl<T> Send for Match<T> where
    T: Send

impl<T> Sync for Match<T> where
    T: Sync

impl<T> Unpin for Match<T> where
    T: Unpin

impl<T> UnwindSafe for Match<T> where
    T: UnwindSafe

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, 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.