Enum Match

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: &Self) -> bool

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

fn is_ignore(self: &Self) -> bool

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

fn is_whitelist(self: &Self) -> bool

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

fn invert(self: Self) -> Match<T>

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

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

Return the value inside this match if it exists.

fn map<U, F: FnOnce(T) -> U>(self: 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: Self, other: Self) -> Self

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

impl<T> Any for Match<T>

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Match<T>

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for Match<T>

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> CloneToUninit for Match<T>

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> Freeze for Match<T>

impl<T> From for Match<T>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Pointable for Match<T>

unsafe fn init(init: <T as Pointable>::Init) -> usize
unsafe fn deref<'a>(ptr: usize) -> &'a T
unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
unsafe fn drop(ptr: usize)

impl<T> RefUnwindSafe for Match<T>

impl<T> Send for Match<T>

impl<T> Sync for Match<T>

impl<T> ToOwned for Match<T>

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T> Unpin for Match<T>

impl<T> UnwindSafe for Match<T>

impl<T, U> Into for Match<T>

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for Match<T>

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for Match<T>

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>

impl<T: $crate::clone::Clone> Clone for Match<T>

fn clone(self: &Self) -> Match<T>

impl<T: $crate::fmt::Debug> Debug for Match<T>

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