pub trait Filter {
// Required method
fn filter(&self, base_path: &Path, path_to_visit: &Path) -> bool;
// Provided methods
fn and<B>(self, other: B) -> And<Self, B>
where Self: Sized,
B: Filter { ... }
fn or<B>(self, other: B) -> Or<Self, B>
where Self: Sized,
B: Filter { ... }
fn not(self) -> Not<Self>
where Self: Sized { ... }
}Required Methods§
sourcefn filter(&self, base_path: &Path, path_to_visit: &Path) -> bool
fn filter(&self, base_path: &Path, path_to_visit: &Path) -> bool
Checks whether path_to_visit should be visited or not. The base_path is
the initial directory provided to the visitor.
This filter is called only for directories, if it returns true
it means that the directory should be visited, otherwise, it will
be skipped.
The directory will be emitted by the iterator regardless of the return value of this function.
Provided Methods§
sourcefn and<B>(self, other: B) -> And<Self, B>where
Self: Sized,
B: Filter,
fn and<B>(self, other: B) -> And<Self, B>where Self: Sized, B: Filter,
Creates a filter that only accepts both this and the other condition.