pub struct Closure<F> { /* private fields */ }Expand description
Closure based predicate.
Create
This type can be created through From and Into traits for any type,
however, it only implements Filter when F: Fn(&Path) -> bool
You can also use Closure::new to create a closure for filter composition, or Closure::from_fn
to avoid the need to introduce explicit types.
Implementations§
Trait Implementations§
source§impl<F> Filter for Closure<F>where
F: Fn(&Path, &Path) -> bool,
impl<F> Filter for Closure<F>where F: Fn(&Path, &Path) -> bool,
source§fn filter(&self, base_dir: &Path, directory: &Path) -> bool
fn filter(&self, base_dir: &Path, directory: &Path) -> bool
Checks whether
path_to_visit should be visited or not. The base_path is
the initial directory provided to the visitor. Read moresource§fn 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.source§impl<F: Ord> Ord for Closure<F>
impl<F: Ord> Ord for Closure<F>
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<F: PartialEq> PartialEq<Closure<F>> for Closure<F>
impl<F: PartialEq> PartialEq<Closure<F>> for Closure<F>
source§impl<F: PartialOrd> PartialOrd<Closure<F>> for Closure<F>
impl<F: PartialOrd> PartialOrd<Closure<F>> for Closure<F>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read more