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) -> Match<T>
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,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Match<T>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Match<T>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for Match<T>
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for Match<T>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> Pointable for Match<T>
const ALIGN: usize = _;type Init = T;unsafe fn init(init: <T as Pointable>::Init) -> usizeunsafe fn deref<'a>(ptr: usize) -> &'a Tunsafe fn deref_mut<'a>(ptr: usize) -> &'a mut Tunsafe fn drop(ptr: usize)
impl<T> ToOwned for Match<T>
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T, U> Into<U> for Match<T>
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for Match<T>
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for Match<T>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>