Struct IncrementalMatch
pub struct IncrementalMatch { /* private fields */ }
The result of an incremental match.
This is similar to Match in that it reports whether a file path should
be ignored, whitelisted or didn't match anything at all. It also has extra
data, such as whether a directory matched but should not be descended into.
Generally speaking, callers that only care about specific files can stick
to the is_none(), is_ignore() or is_whitelist() predicates. Directory
entries are more complicated because we sometimes want to yield directories
to descend into, but not actually visit (e.g., for the minimum depth
filter). Or, we may want to yield a directory to visit but not descend into
(e.g., for the maximum depth filter).
Implementations
impl IncrementalMatch
fn is_none(&self) -> boolReturns true if the match result didn't match anything.
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 should_descend(&self) -> boolReturns true only when this match corresponds to a directory and whether the caller should look inside this directory for additional results.
It is possible for a match to report
falseforIncrementalMatch::is_ignoreandfalseforIncrementalMatch::should_descend. This can occur, for example, when a maximum depth setting allows a directory through, but where none of its children entries should be visited.This is always
falsefor a file path that does not correspond to a directory.fn is_within_depth(&self) -> boolReturns true only when this result corresponds to an entry that is within the depth filter.
This is
falsewhen a path corresponds to a directory and is less than the minimum depth. In this case, callers should continue looking inside that directory.This is always
truefor a match corresponding to a file path that isn't a directory.fn invert(self) -> IncrementalMatchInverts the match so that
IgnorebecomesWhitelistandWhitelistbecomesIgnore. A non-match remains the same.
Trait Implementations
impl Clone for IncrementalMatch
fn clone(&self) -> IncrementalMatch
impl Debug for IncrementalMatch
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Auto Trait Implementations
impl Freeze for IncrementalMatch
impl RefUnwindSafe for IncrementalMatch
impl Send for IncrementalMatch
impl Sync for IncrementalMatch
impl Unpin for IncrementalMatch
impl UnsafeUnpin for IncrementalMatch
impl UnwindSafe for IncrementalMatch
Blanket Implementations
impl<T> Any for IncrementalMatch
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for IncrementalMatch
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for IncrementalMatch
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for IncrementalMatch
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for IncrementalMatch
fn from(t: T) -> TReturns the argument unchanged.
impl<T> Pointable for IncrementalMatch
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 IncrementalMatch
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T, U> Into<U> for IncrementalMatch
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 IncrementalMatch
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for IncrementalMatch
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>