Filter

Struct Filter 

Source
pub struct Filter<I, F> { /* private fields */ }
Expand description

Filter adapter for parallel iterators

Trait Implementations§

Source§

impl<I, F> ParallelIterator for Filter<I, F>
where I: ParallelIterator, F: Fn(&I::Item) -> bool,

Source§

type Item = <I as ParallelIterator>::Item

The type of item being iterated
Source§

fn for_each<G>(self, g: G)
where G: FnMut(Self::Item),

Execute a function on each item (sequential for now)
Source§

fn map<G, R>(self, g: G) -> Map<Self, G>
where G: Fn(Self::Item) -> R,

Map each item (sequential for now)
Source§

fn filter<G>(self, g: G) -> Filter<Self, G>
where G: Fn(&Self::Item) -> bool,

Filter items (sequential for now)
Source§

fn collect<C>(self) -> C
where C: FromParallelIterator<Self::Item>,

Collect into a collection
Source§

fn sum<S>(self) -> S
where S: Sum<Self::Item>,

Sum all items
Source§

fn reduce<RED>(self, reduce_op: RED) -> Option<Self::Item>
where RED: Fn(Self::Item, Self::Item) -> Self::Item,

Reduce items with a reduction function
Source§

fn find_any<P>(self, predicate: P) -> Option<Self::Item>
where P: Fn(&Self::Item) -> bool,

Find any item that matches the predicate
Source§

fn all<P>(self, predicate: P) -> bool
where P: Fn(Self::Item) -> bool,

Check if all items match the predicate
Source§

fn any<P>(self, predicate: P) -> bool
where P: Fn(Self::Item) -> bool,

Check if any item matches the predicate
Source§

fn fold<T, ID, F>(self, identity: ID, fold_op: F) -> Fold<Self, ID, F>
where ID: Fn() -> T, F: Fn(T, Self::Item) -> T,

Fold items with an identity value and accumulator function
Source§

fn cloned<'a, T>(self) -> Cloned<Self>
where Self: ParallelIterator<Item = &'a T>, T: 'a + Clone,

Clone all items (for reference iterators)
Source§

fn count<F>(self, predicate: F) -> usize
where F: Fn(&Self::Item) -> bool,

Count items matching predicate
Source§

fn partition<F>(self, predicate: F) -> (Vec<Self::Item>, Vec<Self::Item>)
where F: Fn(&Self::Item) -> bool,

Partition items based on predicate

Auto Trait Implementations§

§

impl<I, F> Freeze for Filter<I, F>
where I: Freeze, F: Freeze,

§

impl<I, F> RefUnwindSafe for Filter<I, F>

§

impl<I, F> Send for Filter<I, F>
where I: Send, F: Send,

§

impl<I, F> Sync for Filter<I, F>
where I: Sync, F: Sync,

§

impl<I, F> Unpin for Filter<I, F>
where I: Unpin, F: Unpin,

§

impl<I, F> UnwindSafe for Filter<I, F>
where I: UnwindSafe, F: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.