Enum ignore::Match [−][src]
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]
impl<T> Match<T>
pub fn is_none(&self) -> bool
[src]
pub fn is_none(&self) -> bool
Returns true if the match result didn't match any globs.
pub fn is_ignore(&self) -> bool
[src]
pub fn is_ignore(&self) -> bool
Returns true if the match result implies the path should be ignored.
pub fn is_whitelist(&self) -> bool
[src]
pub fn is_whitelist(&self) -> bool
Returns true if the match result implies the path should be whitelisted.
pub fn invert(self) -> Match<T>
[src]
pub fn invert(self) -> Match<T>
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]
pub fn inner(&self) -> Option<&T>
Return the value inside this match if it exists.
pub fn map<U, F: FnOnce(T) -> U>(self, f: F) -> Match<U>
[src]
pub 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.
pub fn or(self, other: Self) -> Self
[src]
pub 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>
[src]
impl<T: Clone> Clone for Match<T>
fn clone(&self) -> Match<T>
[src]
fn clone(&self) -> Match<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<T: Debug> Debug for Match<T>
[src]
impl<T: Debug> Debug for Match<T>