pub enum Match<T> {
None,
Ignore(T),
Whitelist(T),
}
Expand description
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§
source§impl<T> Match<T>
impl<T> Match<T>
sourcepub fn is_ignore(&self) -> bool
pub fn is_ignore(&self) -> bool
Returns true if the match result implies the path should be ignored.
sourcepub fn is_whitelist(&self) -> bool
pub fn is_whitelist(&self) -> bool
Returns true if the match result implies the path should be whitelisted.
sourcepub fn invert(self) -> Match<T>
pub fn invert(self) -> Match<T>
Inverts the match so that Ignore
becomes Whitelist
and
Whitelist
becomes Ignore
. A non-match remains the same.
Trait Implementations§
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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more