pub trait Filter {
// Required method
fn filter(&self, base_path: &Path, path_to_visit: &Path) -> bool;
// Provided methods
fn should_emit(&self, _: &Path) -> bool { ... }
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 should_emit(&self, _: &Path) -> bool
fn should_emit(&self, _: &Path) -> bool
Checks whether dir should be emitted by the iterator.
Sourcefn and<B>(self, other: B) -> And<Self, B>
fn and<B>(self, other: B) -> And<Self, B>
Creates a filter that only accepts both this and the other condition.