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) -> Self
impl Debug for IncrementalMatch
fn fmt(&self, f: &mut Formatter<'_>) -> Result