Enum rayon_cond::CondIterator
source · pub enum CondIterator<P, S>{
Parallel(P),
Serial(S),
}
Expand description
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§
Implementations§
source§impl<P, S> CondIterator<P, S>
impl<P, S> CondIterator<P, S>
pub fn new<I>(iterable: I, parallel: bool) -> Selfwhere
I: IntoParallelIterator<Iter = P, Item = P::Item> + IntoIterator<IntoIter = S, Item = S::Item>,
pub fn from_parallel<I>(iterable: I) -> Selfwhere
I: IntoParallelIterator<Iter = P, Item = P::Item>,
pub fn from_serial<I>(iterable: I) -> Selfwhere
I: IntoIterator<IntoIter = S, Item = S::Item>,
pub fn is_parallel(&self) -> bool
pub fn is_serial(&self) -> bool
source§impl<P, S> CondIterator<P, S>
impl<P, S> CondIterator<P, S>
pub fn into_parallel(self) -> Either<P, IterBridge<S>>
source§impl<P, S> CondIterator<P, S>
impl<P, S> CondIterator<P, S>
pub fn for_each<OP>(self, op: OP)
pub fn for_each_with<OP, T>(self, init: T, op: OP)
pub fn for_each_init<OP, INIT, T>(self, init: INIT, op: OP)
pub fn count(self) -> usize
pub fn map<F, R>(self, map_op: F) -> CondIterator<Map<P, F>, Map<S, F>>
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>>
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>>
pub fn cloned<'a, T>(self) -> CondIterator<Cloned<P>, Cloned<S>>
pub fn copied<'a, T>(self) -> CondIterator<Copied<P>, Copied<S>>
pub fn inspect<OP>( self, inspect_op: OP ) -> CondIterator<Inspect<P, OP>, Inspect<S, OP>>
pub fn update<OP>( self, update_op: OP ) -> CondIterator<Update<P, OP>, Update<S, OP>>
pub fn filter<Pred>( self, filter_op: Pred ) -> CondIterator<Filter<P, Pred>, Filter<S, Pred>>
pub fn filter_map<Pred, R>( self, filter_op: Pred ) -> CondIterator<FilterMap<P, Pred>, FilterMap<S, Pred>>
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>,
pub fn flat_map_iter<F, I>( self, map_op: F ) -> CondIterator<FlatMapIter<P, F>, FlatMap<S, I, F>>
pub fn flatten(self) -> CondIterator<Flatten<P>, Flatten<S>>where
P::Item: IntoParallelIterator,
S::Item: IntoIterator<Item = <P::Item as IntoParallelIterator>::Item>,
pub fn flatten_iter(self) -> CondIterator<FlattenIter<P>, Flatten<S>>
pub fn reduce<OP, ID>(self, identity: ID, op: OP) -> P::Item
pub fn reduce_with<OP>(self, op: OP) -> Option<P::Item>
pub fn fold<T, ID, F>( self, identity: ID, fold_op: F ) -> CondIterator<Fold<P, ID, F>, Once<T>>
pub fn fold_with<F, T>( self, init: T, fold_op: F ) -> CondIterator<FoldWith<P, T, F>, Once<T>>
pub fn sum<Sum>(self) -> Sum
pub fn product<Product>(self) -> Product
pub fn min(self) -> Option<P::Item>
pub fn min_by<F>(self, f: F) -> Option<P::Item>
pub fn min_by_key<K, F>(self, f: F) -> Option<P::Item>
pub fn max(self) -> Option<P::Item>
pub fn max_by<F>(self, f: F) -> Option<P::Item>
pub fn max_by_key<K, F>(self, f: F) -> Option<P::Item>
pub fn chain<C>( self, chain: C ) -> CondIterator<Chain<P, C::Iter>, Chain<S, C::IntoIter>>
pub fn find_any<Pred>(self, predicate: Pred) -> Option<P::Item>
pub fn find_first<Pred>(self, predicate: Pred) -> Option<P::Item>
pub fn any<Pred>(self, predicate: Pred) -> bool
pub fn all<Pred>(self, predicate: Pred) -> bool
pub fn while_some<T>(self) -> CondIterator<WhileSome<P>, WhileSome<S>>
pub fn collect<C>(self) -> Cwhere
C: FromCondIterator<P::Item>,
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,
pub fn partition<A, B, Pred>(self, predicate: Pred) -> (A, B)
pub fn partition_map<A, B, Pred, L, R>(self, predicate: Pred) -> (A, B)
pub fn intersperse( self, element: P::Item ) -> CondIterator<Intersperse<P>, Intersperse<S>>
pub fn opt_len(&self) -> Option<usize>
source§impl<P, S> CondIterator<P, S>
impl<P, S> CondIterator<P, S>
source§impl<P, S> CondIterator<P, S>
impl<P, S> CondIterator<P, S>
pub fn collect_into_vec(self, target: &mut Vec<P::Item>)
pub fn unzip_into_vecs<A, B>(self, left: &mut Vec<A>, right: &mut Vec<B>)
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,
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,
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>,
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>,
pub fn cmp<I>(self, other: I) -> Orderingwhere
I: IntoParallelIterator<Item = P::Item> + IntoIterator<Item = S::Item>,
I::Iter: IndexedParallelIterator,
P::Item: Ord,
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>,
pub fn eq<I>(self, other: I) -> boolwhere
I: IntoParallelIterator + IntoIterator<Item = <I as IntoParallelIterator>::Item>,
I::Iter: IndexedParallelIterator,
P::Item: PartialEq<<I as IntoParallelIterator>::Item>,
pub fn ne<I>(self, other: I) -> boolwhere
I: IntoParallelIterator + IntoIterator<Item = <I as IntoParallelIterator>::Item>,
I::Iter: IndexedParallelIterator,
P::Item: PartialEq<<I as IntoParallelIterator>::Item>,
pub fn lt<I>(self, other: I) -> boolwhere
I: IntoParallelIterator + IntoIterator<Item = <I as IntoParallelIterator>::Item>,
I::Iter: IndexedParallelIterator,
P::Item: PartialOrd<<I as IntoParallelIterator>::Item>,
pub fn le<I>(self, other: I) -> boolwhere
I: IntoParallelIterator + IntoIterator<Item = <I as IntoParallelIterator>::Item>,
I::Iter: IndexedParallelIterator,
P::Item: PartialOrd<<I as IntoParallelIterator>::Item>,
pub fn gt<I>(self, other: I) -> boolwhere
I: IntoParallelIterator + IntoIterator<Item = <I as IntoParallelIterator>::Item>,
I::Iter: IndexedParallelIterator,
P::Item: PartialOrd<<I as IntoParallelIterator>::Item>,
pub fn ge<I>(self, other: I) -> boolwhere
I: IntoParallelIterator + IntoIterator<Item = <I as IntoParallelIterator>::Item>,
I::Iter: IndexedParallelIterator,
P::Item: PartialOrd<<I as IntoParallelIterator>::Item>,
pub fn enumerate(self) -> CondIterator<Enumerate<P>, Enumerate<S>>
pub fn skip(self, n: usize) -> CondIterator<Skip<P>, Skip<S>>
pub fn take(self, n: usize) -> CondIterator<Take<P>, Take<S>>
pub fn position_any<Pred>(self, predicate: Pred) -> Option<usize>
pub fn position_first<Pred>(self, predicate: Pred) -> Option<usize>
pub fn positions<Pred>( self, predicate: Pred ) -> CondIterator<Positions<P, Pred>, Positions<S, Pred>>
pub fn step_by(self, step: usize) -> CondIterator<StepBy<P>, StepBy<S>>
source§impl<P, S> CondIterator<P, S>
impl<P, S> CondIterator<P, S>
pub fn rev(self) -> CondIterator<Rev<P>, Rev<S>>
source§impl<P, S> CondIterator<P, S>
impl<P, S> CondIterator<P, S>
source§impl<P, S> CondIterator<P, S>
impl<P, S> CondIterator<P, S>
Auto Trait Implementations§
impl<P, S> Freeze for CondIterator<P, S>
impl<P, S> RefUnwindSafe for CondIterator<P, S>where
P: RefUnwindSafe,
S: RefUnwindSafe,
impl<P, S> Send for CondIterator<P, S>where
S: Send,
impl<P, S> Sync for CondIterator<P, S>
impl<P, S> Unpin for CondIterator<P, S>
impl<P, S> UnwindSafe for CondIterator<P, S>where
P: UnwindSafe,
S: 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