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) -> bool

Returns true if the match result didn't match anything.

fn is_ignore(&self) -> bool

Returns true if the match result implies the path should be ignored.

fn is_whitelist(&self) -> bool

Returns true if the match result implies the path should be whitelisted.

fn should_descend(&self) -> bool

Returns 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 false for IncrementalMatch::is_ignore and false for IncrementalMatch::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 false for a file path that does not correspond to a directory.

fn is_within_depth(&self) -> bool

Returns true only when this result corresponds to an entry that is within the depth filter.

This is false when 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 true for a match corresponding to a file path that isn't a directory.

fn invert(self) -> IncrementalMatch

Inverts the match so that Ignore becomes Whitelist and Whitelist becomes Ignore. 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) -> T

Returns the argument unchanged.

impl<T> Pointable for IncrementalMatch

const ALIGN: usize = _;
type Init = T;
unsafe fn init(init: <T as Pointable>::Init) -> usize
unsafe fn deref<'a>(ptr: usize) -> &'a T
unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
unsafe fn drop(ptr: usize)

impl<T> ToOwned for IncrementalMatch where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

impl<T, U> Into<U> for IncrementalMatch where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses 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>