Enum Match

pub enum Match<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.

Implementations

impl<T> Match<T>

fn is_none(&self) -> bool

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

fn is_ignore(&self) -> bool

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

fn is_whitelist(&self) -> bool

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

fn invert(self) -> Match<T>

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

fn inner(&self) -> Option<&T>

Return the value inside this match if it exists.

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

Apply the given function to the value inside this match.

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

fn or(self, other: Self) -> Self

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

Trait Implementations

impl<T: Clone> Clone for Match<T>

fn clone(&self) -> Self

impl<T: Debug> Debug for Match<T>

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Auto Trait Implementations

impl<T> Freeze for Match<T> where T: Freeze + Freeze,

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

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

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

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

impl<T> UnsafeUnpin for Match<T> where T: UnsafeUnpin + UnsafeUnpin,

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

Blanket Implementations

impl<T> Any for Match<T> where T: 'static + ?Sized,

impl<T> Borrow<T> for Match<T> where T: ?Sized,

impl<T> BorrowMut<T> for Match<T> where T: ?Sized,

impl<T> CloneToUninit for Match<T> where T: Clone,

impl<T> From<T> for Match<T>

impl<T> Pointable for Match<T>

impl<T> ToOwned for Match<T> where T: Clone,

impl<T, U> Into<U> for Match<T> where U: From<T>,

impl<T, U> TryFrom<U> for Match<T> where U: Into<T>,

impl<T, U> TryInto<U> for Match<T> where U: TryFrom<T>,