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) -> boolReturns true if the match result didn't match any globs.
fn is_ignore(&self) -> boolReturns true if the match result implies the path should be ignored.
fn is_whitelist(&self) -> boolReturns true if the match result implies the path should be whitelisted.
fn invert(self) -> Match<T>Inverts the match so that
IgnorebecomesWhitelistandWhitelistbecomesIgnore. 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) -> SelfReturn 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