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>
impl<F> Filter for Closure<F>
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 should_emit(&self, _: &Path) -> bool
fn should_emit(&self, _: &Path) -> bool
Checks whether
dir should be emitted by the iterator.Source§fn 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.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: PartialOrd> PartialOrd for Closure<F>
impl<F: PartialOrd> PartialOrd for Closure<F>
impl<F: Copy> Copy for Closure<F>
impl<F: Eq> Eq for Closure<F>
impl<F> StructuralPartialEq for Closure<F>
Auto Trait Implementations§
impl<F> Freeze for Closure<F>where
F: Freeze,
impl<F> RefUnwindSafe for Closure<F>where
F: RefUnwindSafe,
impl<F> Send for Closure<F>where
F: Send,
impl<F> Sync for Closure<F>where
F: Sync,
impl<F> Unpin for Closure<F>where
F: Unpin,
impl<F> UnwindSafe for Closure<F>where
F: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more