[][src]Enum rayon_cond::CondIterator

pub enum CondIterator<P, S> where
    P: ParallelIterator,
    S: Iterator<Item = P::Item>, 
{ Parallel(P), Serial(S), }

An iterator that could be parallel or serial, with a common API either way.

The available methods mostly follow ParallelIterator and IndexedParallelIterator, as rayon has the stricter requirements, and they are parallelized with rayon::iter types. Serial implementations use appropriate types from std::iter and itertools::structs.

Variants

Parallel(P)Serial(S)

Methods

impl<P, S> CondIterator<P, S> where
    P: ParallelIterator,
    S: Iterator<Item = P::Item>, 
[src]

pub fn new<I>(iterable: I, parallel: bool) -> Self where
    I: IntoParallelIterator<Iter = P, Item = P::Item> + IntoIterator<IntoIter = S, Item = S::Item>, 
[src]

pub fn from_parallel<I>(iterable: I) -> Self where
    I: IntoParallelIterator<Iter = P, Item = P::Item>, 
[src]

pub fn from_serial<I>(iterable: I) -> Self where
    I: IntoIterator<IntoIter = S, Item = S::Item>, 
[src]

pub fn is_parallel(&self) -> bool[src]

pub fn is_serial(&self) -> bool[src]

impl<P, S> CondIterator<P, S> where
    P: ParallelIterator,
    S: Iterator<Item = P::Item> + Send
[src]

pub fn into_parallel(self) -> Either<P, IterBridge<S>>[src]

impl<P, S> CondIterator<P, S> where
    P: ParallelIterator,
    S: Iterator<Item = P::Item>, 
[src]

pub fn for_each<OP>(self, op: OP) where
    OP: Fn(P::Item) + Sync + Send
[src]

pub fn for_each_with<OP, T>(self, init: T, op: OP) where
    OP: Fn(&mut T, P::Item) + Sync + Send,
    T: Send + Clone
[src]

pub fn for_each_init<OP, INIT, T>(self, init: INIT, op: OP) where
    OP: Fn(&mut T, P::Item) + Sync + Send,
    INIT: Fn() -> T + Sync + Send
[src]

pub fn count(self) -> usize[src]

pub fn map<F, R>(self, map_op: F) -> CondIterator<Map<P, F>, Map<S, F>> where
    F: Fn(P::Item) -> R + Sync + Send,
    R: Send
[src]

pub fn map_with<F, T, R>(
    self,
    init: T,
    map_op: F
) -> CondIterator<MapWith<P, T, F>, Map<S, impl FnMut(P::Item) -> R>> where
    F: Fn(&mut T, P::Item) -> R + Sync + Send,
    T: Send + Clone,
    R: Send
[src]

pub fn map_init<F, INIT, T, R>(
    self,
    init: INIT,
    map_op: F
) -> CondIterator<MapInit<P, INIT, F>, Map<S, impl FnMut(P::Item) -> R>> where
    F: Fn(&mut T, P::Item) -> R + Sync + Send,
    INIT: Fn() -> T + Sync + Send,
    R: Send
[src]

pub fn cloned<'a, T>(self) -> CondIterator<Cloned<P>, Cloned<S>> where
    T: 'a + Clone + Sync + Send,
    P: ParallelIterator<Item = &'a T>,
    S: Iterator<Item = &'a T>, 
[src]

pub fn inspect<OP>(
    self,
    inspect_op: OP
) -> CondIterator<Inspect<P, OP>, Inspect<S, OP>> where
    OP: Fn(&P::Item) + Sync + Send
[src]

pub fn update<OP>(
    self,
    update_op: OP
) -> CondIterator<Update<P, OP>, Update<S, OP>> where
    OP: Fn(&mut P::Item) + Sync + Send
[src]

pub fn filter<Pred>(
    self,
    filter_op: Pred
) -> CondIterator<Filter<P, Pred>, Filter<S, Pred>> where
    Pred: Fn(&P::Item) -> bool + Sync + Send
[src]

pub fn filter_map<Pred, R>(
    self,
    filter_op: Pred
) -> CondIterator<FilterMap<P, Pred>, FilterMap<S, Pred>> where
    Pred: Fn(P::Item) -> Option<R> + Sync + Send,
    R: Send
[src]

pub fn flat_map<F, I>(
    self,
    map_op: F
) -> CondIterator<FlatMap<P, F>, FlatMap<S, I, F>> where
    F: Fn(P::Item) -> I + Sync + Send,
    I: IntoParallelIterator + IntoIterator<Item = <I as IntoParallelIterator>::Item>, 
[src]

pub fn flatten(self) -> CondIterator<Flatten<P>, Flatten<S>> where
    P::Item: IntoParallelIterator,
    S::Item: IntoIterator<Item = <P::Item as IntoParallelIterator>::Item>, 
[src]

pub fn reduce<OP, ID>(self, identity: ID, op: OP) -> P::Item where
    OP: Fn(P::Item, P::Item) -> P::Item + Sync + Send,
    ID: Fn() -> P::Item + Sync + Send
[src]

pub fn reduce_with<OP>(self, op: OP) -> Option<P::Item> where
    OP: Fn(P::Item, P::Item) -> P::Item + Sync + Send
[src]

pub fn fold<T, ID, F>(
    self,
    identity: ID,
    fold_op: F
) -> CondIterator<Fold<P, ID, F>, Once<T>> where
    F: Fn(T, P::Item) -> T + Sync + Send,
    ID: Fn() -> T + Sync + Send,
    T: Send
[src]

pub fn fold_with<F, T>(
    self,
    init: T,
    fold_op: F
) -> CondIterator<FoldWith<P, T, F>, Once<T>> where
    F: Fn(T, P::Item) -> T + Sync + Send,
    T: Send + Clone
[src]

pub fn sum<Sum>(self) -> Sum where
    Sum: Send + Sum<P::Item> + Sum<Sum>, 
[src]

pub fn product<Product>(self) -> Product where
    Product: Send + Product<P::Item> + Product<Product>, 
[src]

pub fn min(self) -> Option<P::Item> where
    P::Item: Ord
[src]

pub fn min_by<F>(self, f: F) -> Option<P::Item> where
    F: Sync + Send + Fn(&P::Item, &P::Item) -> Ordering
[src]

pub fn min_by_key<K, F>(self, f: F) -> Option<P::Item> where
    K: Ord + Send,
    F: Sync + Send + Fn(&P::Item) -> K, 
[src]

pub fn max(self) -> Option<P::Item> where
    P::Item: Ord
[src]

pub fn max_by<F>(self, f: F) -> Option<P::Item> where
    F: Sync + Send + Fn(&P::Item, &P::Item) -> Ordering
[src]

pub fn max_by_key<K, F>(self, f: F) -> Option<P::Item> where
    K: Ord + Send,
    F: Sync + Send + Fn(&P::Item) -> K, 
[src]

pub fn chain<C>(
    self,
    chain: C
) -> CondIterator<Chain<P, C::Iter>, Chain<S, C::IntoIter>> where
    C: IntoParallelIterator<Item = P::Item> + IntoIterator<Item = P::Item>, 
[src]

pub fn find_any<Pred>(self, predicate: Pred) -> Option<P::Item> where
    Pred: Fn(&P::Item) -> bool + Sync + Send
[src]

pub fn find_first<Pred>(self, predicate: Pred) -> Option<P::Item> where
    Pred: Fn(&P::Item) -> bool + Sync + Send
[src]

pub fn any<Pred>(self, predicate: Pred) -> bool where
    Pred: Fn(P::Item) -> bool + Sync + Send
[src]

pub fn all<Pred>(self, predicate: Pred) -> bool where
    Pred: Fn(P::Item) -> bool + Sync + Send
[src]

pub fn while_some<T>(self) -> CondIterator<WhileSome<P>, WhileSome<S>> where
    P: ParallelIterator<Item = Option<T>>,
    S: Iterator<Item = Option<T>>,
    T: Send
[src]

pub fn collect<C>(self) -> C where
    C: FromCondIterator<P::Item>, 
[src]

pub fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB) where
    P: ParallelIterator<Item = (A, B)>,
    S: Iterator<Item = (A, B)>,
    FromA: Default + Send + CondExtend<A>,
    FromB: Default + Send + CondExtend<B>,
    A: Send,
    B: Send
[src]

pub fn partition<A, B, Pred>(self, predicate: Pred) -> (A, B) where
    A: Default + Send + CondExtend<P::Item>,
    B: Default + Send + CondExtend<P::Item>,
    Pred: Fn(&P::Item) -> bool + Sync + Send
[src]

pub fn partition_map<A, B, Pred, L, R>(self, predicate: Pred) -> (A, B) where
    A: Default + Send + CondExtend<L>,
    B: Default + Send + CondExtend<R>,
    Pred: Fn(P::Item) -> Either<L, R> + Sync + Send,
    L: Send,
    R: Send
[src]

pub fn intersperse(
    self,
    element: P::Item
) -> CondIterator<Intersperse<P>, Intersperse<S>> where
    P::Item: Clone
[src]

pub fn opt_len(&self) -> Option<usize>[src]

impl<P, S> CondIterator<P, S> where
    P: ParallelIterator,
    S: DoubleEndedIterator<Item = P::Item>, 
[src]

pub fn find_last<Pred>(self, predicate: Pred) -> Option<P::Item> where
    Pred: Fn(&P::Item) -> bool + Sync + Send
[src]

impl<P, S> CondIterator<P, S> where
    P: IndexedParallelIterator,
    S: Iterator<Item = P::Item>, 
[src]

pub fn collect_into_vec(self, target: &mut Vec<P::Item>)[src]

pub fn unzip_into_vecs<A, B>(self, left: &mut Vec<A>, right: &mut Vec<B>) where
    P: IndexedParallelIterator<Item = (A, B)>,
    S: Iterator<Item = (A, B)>,
    A: Send,
    B: Send
[src]

pub fn zip<Z>(
    self,
    other: Z
) -> CondIterator<Zip<P, Z::Iter>, Zip<S, Z::IntoIter>> where
    Z: IntoParallelIterator + IntoIterator<Item = <Z as IntoParallelIterator>::Item>,
    Z::Iter: IndexedParallelIterator
[src]

pub fn zip_eq<Z>(
    self,
    other: Z
) -> CondIterator<ZipEq<P, Z::Iter>, ZipEq<S, Z::IntoIter>> where
    Z: IntoParallelIterator + IntoIterator<Item = <Z as IntoParallelIterator>::Item>,
    Z::Iter: IndexedParallelIterator
[src]

pub fn interleave<I>(
    self,
    other: I
) -> CondIterator<Interleave<P, I::Iter>, Interleave<S, I::IntoIter>> where
    I: IntoParallelIterator<Item = P::Item> + IntoIterator<Item = S::Item>,
    I::Iter: IndexedParallelIterator<Item = P::Item>, 
[src]

pub fn interleave_shortest<I>(
    self,
    other: I
) -> CondIterator<InterleaveShortest<P, I::Iter>, InterleaveShortest<S, I::IntoIter>> where
    I: IntoParallelIterator<Item = P::Item> + IntoIterator<Item = S::Item>,
    I::Iter: IndexedParallelIterator<Item = P::Item>, 
[src]

pub fn cmp<I>(self, other: I) -> Ordering where
    I: IntoParallelIterator<Item = P::Item> + IntoIterator<Item = S::Item>,
    I::Iter: IndexedParallelIterator,
    P::Item: Ord
[src]

pub fn partial_cmp<I>(self, other: I) -> Option<Ordering> where
    I: IntoParallelIterator + IntoIterator<Item = <I as IntoParallelIterator>::Item>,
    I::Iter: IndexedParallelIterator,
    P::Item: PartialOrd<<I as IntoParallelIterator>::Item>, 
[src]

pub fn eq<I>(self, other: I) -> bool where
    I: IntoParallelIterator + IntoIterator<Item = <I as IntoParallelIterator>::Item>,
    I::Iter: IndexedParallelIterator,
    P::Item: PartialEq<<I as IntoParallelIterator>::Item>, 
[src]

pub fn ne<I>(self, other: I) -> bool where
    I: IntoParallelIterator + IntoIterator<Item = <I as IntoParallelIterator>::Item>,
    I::Iter: IndexedParallelIterator,
    P::Item: PartialEq<<I as IntoParallelIterator>::Item>, 
[src]

pub fn lt<I>(self, other: I) -> bool where
    I: IntoParallelIterator + IntoIterator<Item = <I as IntoParallelIterator>::Item>,
    I::Iter: IndexedParallelIterator,
    P::Item: PartialOrd<<I as IntoParallelIterator>::Item>, 
[src]

pub fn le<I>(self, other: I) -> bool where
    I: IntoParallelIterator + IntoIterator<Item = <I as IntoParallelIterator>::Item>,
    I::Iter: IndexedParallelIterator,
    P::Item: PartialOrd<<I as IntoParallelIterator>::Item>, 
[src]

pub fn gt<I>(self, other: I) -> bool where
    I: IntoParallelIterator + IntoIterator<Item = <I as IntoParallelIterator>::Item>,
    I::Iter: IndexedParallelIterator,
    P::Item: PartialOrd<<I as IntoParallelIterator>::Item>, 
[src]

pub fn ge<I>(self, other: I) -> bool where
    I: IntoParallelIterator + IntoIterator<Item = <I as IntoParallelIterator>::Item>,
    I::Iter: IndexedParallelIterator,
    P::Item: PartialOrd<<I as IntoParallelIterator>::Item>, 
[src]

pub fn enumerate(self) -> CondIterator<Enumerate<P>, Enumerate<S>>[src]

pub fn skip(self, n: usize) -> CondIterator<Skip<P>, Skip<S>>[src]

pub fn take(self, n: usize) -> CondIterator<Take<P>, Take<S>>[src]

pub fn position_any<Pred>(self, predicate: Pred) -> Option<usize> where
    Pred: Fn(P::Item) -> bool + Sync + Send
[src]

pub fn position_first<Pred>(self, predicate: Pred) -> Option<usize> where
    Pred: Fn(P::Item) -> bool + Sync + Send
[src]

impl<P, S> CondIterator<P, S> where
    P: IndexedParallelIterator,
    S: DoubleEndedIterator<Item = P::Item>, 
[src]

pub fn rev(self) -> CondIterator<Rev<P>, Rev<S>>[src]

impl<P, S> CondIterator<P, S> where
    P: IndexedParallelIterator,
    S: ExactSizeIterator<Item = P::Item>, 
[src]

pub fn len(&self) -> usize[src]

impl<P, S> CondIterator<P, S> where
    P: IndexedParallelIterator,
    S: ExactSizeIterator + DoubleEndedIterator<Item = P::Item>, 
[src]

pub fn position_last<Pred>(self, predicate: Pred) -> Option<usize> where
    Pred: Fn(P::Item) -> bool + Sync + Send
[src]

Auto Trait Implementations

impl<P, S> Send for CondIterator<P, S> where
    S: Send

impl<P, S> Sync for CondIterator<P, S> where
    P: Sync,
    S: Sync

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.