[−][src]Enum rayon_cond::CondIterator
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]
P: ParallelIterator,
S: Iterator<Item = P::Item>,
pub fn new<I>(iterable: I, parallel: bool) -> Self where
I: IntoParallelIterator<Iter = P, Item = P::Item> + IntoIterator<IntoIter = S, Item = S::Item>,
[src]
I: IntoParallelIterator<Iter = P, Item = P::Item> + IntoIterator<IntoIter = S, Item = S::Item>,
pub fn from_parallel<I>(iterable: I) -> Self where
I: IntoParallelIterator<Iter = P, Item = P::Item>,
[src]
I: IntoParallelIterator<Iter = P, Item = P::Item>,
pub fn from_serial<I>(iterable: I) -> Self where
I: IntoIterator<IntoIter = S, Item = S::Item>,
[src]
I: IntoIterator<IntoIter = S, Item = S::Item>,
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]
P: ParallelIterator,
S: Iterator<Item = P::Item> + Send,
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]
P: ParallelIterator,
S: Iterator<Item = P::Item>,
pub fn for_each<OP>(self, op: OP) where
OP: Fn(P::Item) + Sync + Send,
[src]
OP: Fn(P::Item) + Sync + Send,
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]
OP: Fn(&mut T, P::Item) + Sync + Send,
T: Send + Clone,
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]
OP: Fn(&mut T, P::Item) + Sync + Send,
INIT: Fn() -> T + Sync + Send,
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]
F: Fn(P::Item) -> R + Sync + Send,
R: Send,
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]
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,
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]
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,
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]
T: 'a + Clone + Sync + Send,
P: ParallelIterator<Item = &'a T>,
S: Iterator<Item = &'a T>,
pub fn inspect<OP>(
self,
inspect_op: OP
) -> CondIterator<Inspect<P, OP>, Inspect<S, OP>> where
OP: Fn(&P::Item) + Sync + Send,
[src]
self,
inspect_op: OP
) -> CondIterator<Inspect<P, OP>, Inspect<S, OP>> where
OP: Fn(&P::Item) + Sync + Send,
pub fn update<OP>(
self,
update_op: OP
) -> CondIterator<Update<P, OP>, Update<S, OP>> where
OP: Fn(&mut P::Item) + Sync + Send,
[src]
self,
update_op: OP
) -> CondIterator<Update<P, OP>, Update<S, OP>> where
OP: Fn(&mut P::Item) + Sync + Send,
pub fn filter<Pred>(
self,
filter_op: Pred
) -> CondIterator<Filter<P, Pred>, Filter<S, Pred>> where
Pred: Fn(&P::Item) -> bool + Sync + Send,
[src]
self,
filter_op: Pred
) -> CondIterator<Filter<P, Pred>, Filter<S, Pred>> where
Pred: Fn(&P::Item) -> bool + Sync + Send,
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]
self,
filter_op: Pred
) -> CondIterator<FilterMap<P, Pred>, FilterMap<S, Pred>> where
Pred: Fn(P::Item) -> Option<R> + Sync + Send,
R: Send,
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]
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 flatten(self) -> CondIterator<Flatten<P>, Flatten<S>> where
P::Item: IntoParallelIterator,
S::Item: IntoIterator<Item = <P::Item as IntoParallelIterator>::Item>,
[src]
P::Item: IntoParallelIterator,
S::Item: IntoIterator<Item = <P::Item as IntoParallelIterator>::Item>,
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]
OP: Fn(P::Item, P::Item) -> P::Item + Sync + Send,
ID: Fn() -> P::Item + Sync + Send,
pub fn reduce_with<OP>(self, op: OP) -> Option<P::Item> where
OP: Fn(P::Item, P::Item) -> P::Item + Sync + Send,
[src]
OP: Fn(P::Item, P::Item) -> P::Item + Sync + Send,
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]
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,
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]
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,
pub fn sum<Sum>(self) -> Sum where
Sum: Send + Sum<P::Item> + Sum<Sum>,
[src]
Sum: Send + Sum<P::Item> + Sum<Sum>,
pub fn product<Product>(self) -> Product where
Product: Send + Product<P::Item> + Product<Product>,
[src]
Product: Send + Product<P::Item> + Product<Product>,
pub fn min(self) -> Option<P::Item> where
P::Item: Ord,
[src]
P::Item: Ord,
pub fn min_by<F>(self, f: F) -> Option<P::Item> where
F: Sync + Send + Fn(&P::Item, &P::Item) -> Ordering,
[src]
F: Sync + Send + Fn(&P::Item, &P::Item) -> Ordering,
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]
K: Ord + Send,
F: Sync + Send + Fn(&P::Item) -> K,
pub fn max(self) -> Option<P::Item> where
P::Item: Ord,
[src]
P::Item: Ord,
pub fn max_by<F>(self, f: F) -> Option<P::Item> where
F: Sync + Send + Fn(&P::Item, &P::Item) -> Ordering,
[src]
F: Sync + Send + Fn(&P::Item, &P::Item) -> Ordering,
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]
K: Ord + Send,
F: Sync + Send + Fn(&P::Item) -> K,
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]
self,
chain: C
) -> CondIterator<Chain<P, C::Iter>, Chain<S, C::IntoIter>> where
C: IntoParallelIterator<Item = P::Item> + IntoIterator<Item = P::Item>,
pub fn find_any<Pred>(self, predicate: Pred) -> Option<P::Item> where
Pred: Fn(&P::Item) -> bool + Sync + Send,
[src]
Pred: Fn(&P::Item) -> bool + Sync + Send,
pub fn find_first<Pred>(self, predicate: Pred) -> Option<P::Item> where
Pred: Fn(&P::Item) -> bool + Sync + Send,
[src]
Pred: Fn(&P::Item) -> bool + Sync + Send,
pub fn any<Pred>(self, predicate: Pred) -> bool where
Pred: Fn(P::Item) -> bool + Sync + Send,
[src]
Pred: Fn(P::Item) -> bool + Sync + Send,
pub fn all<Pred>(self, predicate: Pred) -> bool where
Pred: Fn(P::Item) -> bool + Sync + Send,
[src]
Pred: Fn(P::Item) -> bool + Sync + Send,
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]
P: ParallelIterator<Item = Option<T>>,
S: Iterator<Item = Option<T>>,
T: Send,
pub fn collect<C>(self) -> C where
C: FromCondIterator<P::Item>,
[src]
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,
[src]
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) where
A: Default + Send + CondExtend<P::Item>,
B: Default + Send + CondExtend<P::Item>,
Pred: Fn(&P::Item) -> bool + Sync + Send,
[src]
A: Default + Send + CondExtend<P::Item>,
B: Default + Send + CondExtend<P::Item>,
Pred: Fn(&P::Item) -> bool + Sync + Send,
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]
A: Default + Send + CondExtend<L>,
B: Default + Send + CondExtend<R>,
Pred: Fn(P::Item) -> Either<L, R> + Sync + Send,
L: Send,
R: Send,
pub fn intersperse(
self,
element: P::Item
) -> CondIterator<Intersperse<P>, Intersperse<S>> where
P::Item: Clone,
[src]
self,
element: P::Item
) -> CondIterator<Intersperse<P>, Intersperse<S>> where
P::Item: Clone,
pub fn opt_len(&self) -> Option<usize>
[src]
impl<P, S> CondIterator<P, S> where
P: ParallelIterator,
S: DoubleEndedIterator<Item = P::Item>,
[src]
P: ParallelIterator,
S: DoubleEndedIterator<Item = P::Item>,
pub fn find_last<Pred>(self, predicate: Pred) -> Option<P::Item> where
Pred: Fn(&P::Item) -> bool + Sync + Send,
[src]
Pred: Fn(&P::Item) -> bool + Sync + Send,
impl<P, S> CondIterator<P, S> where
P: IndexedParallelIterator,
S: Iterator<Item = P::Item>,
[src]
P: IndexedParallelIterator,
S: Iterator<Item = P::Item>,
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]
P: IndexedParallelIterator<Item = (A, B)>,
S: Iterator<Item = (A, B)>,
A: Send,
B: Send,
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]
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,
[src]
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>,
[src]
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>,
[src]
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) -> Ordering where
I: IntoParallelIterator<Item = P::Item> + IntoIterator<Item = S::Item>,
I::Iter: IndexedParallelIterator,
P::Item: Ord,
[src]
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>,
[src]
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) -> bool where
I: IntoParallelIterator + IntoIterator<Item = <I as IntoParallelIterator>::Item>,
I::Iter: IndexedParallelIterator,
P::Item: PartialEq<<I as IntoParallelIterator>::Item>,
[src]
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) -> bool where
I: IntoParallelIterator + IntoIterator<Item = <I as IntoParallelIterator>::Item>,
I::Iter: IndexedParallelIterator,
P::Item: PartialEq<<I as IntoParallelIterator>::Item>,
[src]
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) -> bool where
I: IntoParallelIterator + IntoIterator<Item = <I as IntoParallelIterator>::Item>,
I::Iter: IndexedParallelIterator,
P::Item: PartialOrd<<I as IntoParallelIterator>::Item>,
[src]
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) -> bool where
I: IntoParallelIterator + IntoIterator<Item = <I as IntoParallelIterator>::Item>,
I::Iter: IndexedParallelIterator,
P::Item: PartialOrd<<I as IntoParallelIterator>::Item>,
[src]
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) -> bool where
I: IntoParallelIterator + IntoIterator<Item = <I as IntoParallelIterator>::Item>,
I::Iter: IndexedParallelIterator,
P::Item: PartialOrd<<I as IntoParallelIterator>::Item>,
[src]
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) -> bool where
I: IntoParallelIterator + IntoIterator<Item = <I as IntoParallelIterator>::Item>,
I::Iter: IndexedParallelIterator,
P::Item: PartialOrd<<I as IntoParallelIterator>::Item>,
[src]
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>>
[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]
Pred: Fn(P::Item) -> bool + Sync + Send,
pub fn position_first<Pred>(self, predicate: Pred) -> Option<usize> where
Pred: Fn(P::Item) -> bool + Sync + Send,
[src]
Pred: Fn(P::Item) -> bool + Sync + Send,
impl<P, S> CondIterator<P, S> where
P: IndexedParallelIterator,
S: DoubleEndedIterator<Item = P::Item>,
[src]
P: IndexedParallelIterator,
S: DoubleEndedIterator<Item = P::Item>,
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]
P: IndexedParallelIterator,
S: ExactSizeIterator<Item = P::Item>,
impl<P, S> CondIterator<P, S> where
P: IndexedParallelIterator,
S: ExactSizeIterator + DoubleEndedIterator<Item = P::Item>,
[src]
P: IndexedParallelIterator,
S: ExactSizeIterator + DoubleEndedIterator<Item = P::Item>,
pub fn position_last<Pred>(self, predicate: Pred) -> Option<usize> where
Pred: Fn(P::Item) -> bool + Sync + Send,
[src]
Pred: Fn(P::Item) -> bool + Sync + Send,
Auto Trait Implementations
impl<P, S> Send for CondIterator<P, S> where
S: Send,
S: Send,
impl<P, S> Sync for CondIterator<P, S> where
P: Sync,
S: Sync,
P: Sync,
S: Sync,
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,