Struct rayon::range::Iter
[−]
[src]
pub struct Iter<T> { /* fields omitted */ }
Parallel iterator over a range
Trait Implementations
impl ParallelIterator for Iter<u8>
[src]
type Item = u8
fn drive_unindexed<C>(self, consumer: C) -> C::Result where
C: UnindexedConsumer<Self::Item>,
[src]
C: UnindexedConsumer<Self::Item>,
Internal method used to define the behavior of this parallel iterator. You should not need to call this directly. Read more
fn opt_len(&mut self) -> Option<usize>
[src]
Internal method used to define the behavior of this parallel iterator. You should not need to call this directly. Read more
fn weight(self, _scale: f64) -> Weight<Self>
[src]
: try with_min_len
or with_max_len
instead
Deprecated. If the adaptive algorithms don't split appropriately, try IndexedParallelIterator::with_min_len()
or with_max_len()
instead. Read more
fn weight_max(self) -> Weight<Self>
[src]
: try with_min_len
or with_max_len
instead
Deprecated. If the adaptive algorithms don't split appropriately, try IndexedParallelIterator::with_min_len()
or with_max_len()
instead. Read more
fn for_each<OP>(self, op: OP) where
OP: Fn(Self::Item) + Sync,
[src]
OP: Fn(Self::Item) + Sync,
Executes OP
on each item produced by the iterator, in parallel.
fn count(self) -> usize
[src]
Counts the number of items in this parallel iterator.
fn map<F, R>(self, map_op: F) -> Map<Self, MapFn<F>> where
F: Fn(Self::Item) -> R + Sync,
R: Send,
[src]
F: Fn(Self::Item) -> R + Sync,
R: Send,
Applies map_op
to each item of this iterator, producing a new iterator with the results. Read more
fn cloned<'a, T>(self) -> Map<Self, MapCloned> where
T: 'a + Clone + Send,
Self: ParallelIterator<Item = &'a T>,
[src]
T: 'a + Clone + Send,
Self: ParallelIterator<Item = &'a T>,
Creates an iterator which clones all of its elements. This may be useful when you have an iterator over &T
, but you need T
. Read more
fn inspect<OP>(self, inspect_op: OP) -> Map<Self, MapInspect<OP>> where
OP: Fn(&Self::Item) + Sync,
[src]
OP: Fn(&Self::Item) + Sync,
Applies inspect_op
to a reference to each item of this iterator, producing a new iterator passing through the original items. This is often useful for debugging to see what's happening in iterator stages. Read more
fn filter<P>(self, filter_op: P) -> Filter<Self, P> where
P: Fn(&Self::Item) -> bool + Sync,
[src]
P: Fn(&Self::Item) -> bool + Sync,
Applies filter_op
to each item of this iterator, producing a new iterator with only the items that gave true
results. Read more
fn filter_map<P, R>(self, filter_op: P) -> FilterMap<Self, P> where
P: Fn(Self::Item) -> Option<R> + Sync,
R: Send,
[src]
P: Fn(Self::Item) -> Option<R> + Sync,
R: Send,
Applies filter_op
to each item of this iterator to get an Option
, producing a new iterator with only the items from Some
results. Read more
fn flat_map<F, PI>(self, map_op: F) -> FlatMap<Self, F> where
F: Fn(Self::Item) -> PI + Sync,
PI: IntoParallelIterator,
[src]
F: Fn(Self::Item) -> PI + Sync,
PI: IntoParallelIterator,
Applies map_op
to each item of this iterator to get nested iterators, producing a new iterator that flattens these back into one. Read more
fn reduce<OP, ID>(self, identity: ID, op: OP) -> Self::Item where
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
ID: Fn() -> Self::Item + Sync,
[src]
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
ID: Fn() -> Self::Item + Sync,
Reduces the items in the iterator into one item using op
. The argument identity
should be a closure that can produce "identity" value which may be inserted into the sequence as needed to create opportunities for parallel execution. So, for example, if you are doing a summation, then identity()
ought to produce something that represents the zero for your type (but consider just calling sum()
in that case). Read more
fn reduce_with<OP>(self, op: OP) -> Option<Self::Item> where
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
[src]
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
Reduces the items in the iterator into one item using op
. If the iterator is empty, None
is returned; otherwise, Some
is returned. Read more
fn reduce_with_identity<OP>(self, identity: Self::Item, op: OP) -> Self::Item where
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
Self::Item: Clone + Sync,
[src]
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
Self::Item: Clone + Sync,
: call reduce
instead
Deprecated. Use reduce()
instead.
fn fold<T, ID, F>(self, identity: ID, fold_op: F) -> Fold<Self, ID, F> where
F: Fn(T, Self::Item) -> T + Sync,
ID: Fn() -> T + Sync,
T: Send,
[src]
F: Fn(T, Self::Item) -> T + Sync,
ID: Fn() -> T + Sync,
T: Send,
Parallel fold is similar to sequential fold except that the sequence of items may be subdivided before it is folded. Consider a list of numbers like 22 3 77 89 46
. If you used sequential fold to add them (fold(0, |a,b| a+b)
, you would wind up first adding 0 + 22, then 22 + 3, then 25 + 77, and so forth. The parallel fold works similarly except that it first breaks up your list into sublists, and hence instead of yielding up a single sum at the end, it yields up multiple sums. The number of results is nondeterministic, as is the point where the breaks occur. Read more
fn sum<S>(self) -> S where
S: Send + Sum<Self::Item> + Sum,
[src]
S: Send + Sum<Self::Item> + Sum,
Sums up the items in the iterator. Read more
fn product<P>(self) -> P where
P: Send + Product<Self::Item> + Product,
[src]
P: Send + Product<Self::Item> + Product,
Multiplies all the items in the iterator. Read more
fn mul(self) -> Self::Item where
Self::Item: Product,
[src]
Self::Item: Product,
: name changed to product()
to match sequential iterators
DEPRECATED
fn min(self) -> Option<Self::Item> where
Self::Item: Ord,
[src]
Self::Item: Ord,
Computes the minimum of all the items in the iterator. If the iterator is empty, None
is returned; otherwise, Some(min)
is returned. Read more
fn min_by_key<K, F>(self, f: F) -> Option<Self::Item> where
K: Ord + Send,
F: Sync + Fn(&Self::Item) -> K,
[src]
K: Ord + Send,
F: Sync + Fn(&Self::Item) -> K,
Computes the item that yields the minimum value for the given function. If the iterator is empty, None
is returned; otherwise, Some(item)
is returned. Read more
fn max(self) -> Option<Self::Item> where
Self::Item: Ord,
[src]
Self::Item: Ord,
Computes the maximum of all the items in the iterator. If the iterator is empty, None
is returned; otherwise, Some(max)
is returned. Read more
fn max_by_key<K, F>(self, f: F) -> Option<Self::Item> where
K: Ord + Send,
F: Sync + Fn(&Self::Item) -> K,
[src]
K: Ord + Send,
F: Sync + Fn(&Self::Item) -> K,
Computes the item that yields the maximum value for the given function. If the iterator is empty, None
is returned; otherwise, Some(item)
is returned. Read more
fn chain<C>(self, chain: C) -> Chain<Self, C::Iter> where
C: IntoParallelIterator<Item = Self::Item>,
[src]
C: IntoParallelIterator<Item = Self::Item>,
Takes two iterators and creates a new iterator over both.
fn find_any<P>(self, predicate: P) -> Option<Self::Item> where
P: Fn(&Self::Item) -> bool + Sync,
[src]
P: Fn(&Self::Item) -> bool + Sync,
Searches for some item in the parallel iterator that matches the given predicate and returns it. This operation is similar to [find
on sequential iterators][find] but the item returned may not be the first one in the parallel sequence which matches, since we search the entire sequence in parallel. Read more
fn find_first<P>(self, predicate: P) -> Option<Self::Item> where
P: Fn(&Self::Item) -> bool + Sync,
[src]
P: Fn(&Self::Item) -> bool + Sync,
Searches for the first item in the parallel iterator that matches the given predicate and returns it. Read more
fn find_last<P>(self, predicate: P) -> Option<Self::Item> where
P: Fn(&Self::Item) -> bool + Sync,
[src]
P: Fn(&Self::Item) -> bool + Sync,
Searches for the last item in the parallel iterator that matches the given predicate and returns it. Read more
fn any<P>(self, predicate: P) -> bool where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Searches for some item in the parallel iterator that matches the given predicate, and if so returns true. Once a match is found, we'll attempt to stop process the rest of the items. Proving that there's no match, returning false, does require visiting every item. Read more
fn all<P>(self, predicate: P) -> bool where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Tests that every item in the parallel iterator matches the given predicate, and if so returns true. If a counter-example is found, we'll attempt to stop processing more items, then return false. Read more
fn collect<C>(self) -> C where
C: FromParallelIterator<Self::Item>,
[src]
C: FromParallelIterator<Self::Item>,
Create a fresh collection containing all the element produced by this parallel iterator. Read more
impl BoundedParallelIterator for Iter<u8>
[src]
fn upper_bound(&mut self) -> usize
[src]
fn drive<C>(self, consumer: C) -> C::Result where
C: Consumer<Self::Item>,
[src]
C: Consumer<Self::Item>,
Internal method used to define the behavior of this parallel iterator. You should not need to call this directly. Read more
impl ExactParallelIterator for Iter<u8>
[src]
fn len(&mut self) -> usize
[src]
Produces an exact count of how many items this iterator will produce, presuming no panic occurs. Read more
fn collect_into(self, target: &mut Vec<Self::Item>)
[src]
Collects the results of the iterator into the specified vector. The vector is always truncated before execution begins. If possible, reusing the vector across calls can lead to better performance since it reuses the same backing buffer. Read more
impl IndexedParallelIterator for Iter<u8>
[src]
fn with_producer<CB>(self, callback: CB) -> CB::Output where
CB: ProducerCallback<Self::Item>,
[src]
CB: ProducerCallback<Self::Item>,
Internal method used to define the behavior of this parallel iterator. You should not need to call this directly. Read more
fn zip<Z>(self, zip_op: Z) -> Zip<Self, Z::Iter> where
Z: IntoParallelIterator,
Z::Iter: IndexedParallelIterator,
[src]
Z: IntoParallelIterator,
Z::Iter: IndexedParallelIterator,
Iterate over tuples (A, B)
, where the items A
are from this iterator and B
are from the iterator given as argument. Like the zip
method on ordinary iterators, if the two iterators are of unequal length, you only get the items they have in common. Read more
fn cmp<I>(self, other: I) -> Ordering where
I: IntoParallelIterator<Item = Self::Item>,
I::Iter: IndexedParallelIterator,
Self::Item: Ord,
[src]
I: IntoParallelIterator<Item = Self::Item>,
I::Iter: IndexedParallelIterator,
Self::Item: Ord,
Lexicographically compares the elements of this ParallelIterator
with those of another. Read more
fn partial_cmp<I>(self, other: I) -> Option<Ordering> where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
Lexicographically compares the elements of this ParallelIterator
with those of another. Read more
fn eq<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialEq<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialEq<I::Item>,
Determines if the elements of this ParallelIterator
are equal to those of another Read more
fn ne<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialEq<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialEq<I::Item>,
Determines if the elements of this ParallelIterator
are unequal to those of another Read more
fn lt<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
Determines if the elements of this ParallelIterator
are lexicographically less than those of another. Read more
fn le<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
Determines if the elements of this ParallelIterator
are less or equal to those of another. Read more
fn gt<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
Determines if the elements of this ParallelIterator
are lexicographically greater than those of another. Read more
fn ge<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
Determines if the elements of this ParallelIterator
are less or equal to those of another. Read more
fn enumerate(self) -> Enumerate<Self>
[src]
Yields an index along with each item.
fn skip(self, n: usize) -> Skip<Self>
[src]
Creates an iterator that skips the first n
elements.
fn take(self, n: usize) -> Take<Self>
[src]
Creates an iterator that yields the first n
elements.
fn position_any<P>(self, predicate: P) -> Option<usize> where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Searches for some item in the parallel iterator that matches the given predicate, and returns its index. Like ParallelIterator::find_any
, the parallel search will not necessarily find the first match, and once a match is found we'll attempt to stop processing any more. Read more
fn position_first<P>(self, predicate: P) -> Option<usize> where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Searches for the first item in the parallel iterator that matches the given predicate, and returns its index. Read more
fn position_last<P>(self, predicate: P) -> Option<usize> where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Searches for the last item in the parallel iterator that matches the given predicate, and returns its index. Read more
fn rev(self) -> Rev<Self>
[src]
Produces a new iterator with the elements of this iterator in reverse order. Read more
fn with_min_len(self, min: usize) -> MinLen<Self>
[src]
Sets the minimum length of iterators desired to process in each thread. Rayon will not split any smaller than this length, but of course an iterator could already be smaller to begin with. Read more
fn with_max_len(self, max: usize) -> MaxLen<Self>
[src]
Sets the maximum length of iterators desired to process in each thread. Rayon will try to split at least below this length, unless that would put it below the length from with_min_len()
. For example, given min=10 and max=15, a length of 16 will not be split any further. Read more
impl ParallelIterator for Iter<u16>
[src]
type Item = u16
fn drive_unindexed<C>(self, consumer: C) -> C::Result where
C: UnindexedConsumer<Self::Item>,
[src]
C: UnindexedConsumer<Self::Item>,
Internal method used to define the behavior of this parallel iterator. You should not need to call this directly. Read more
fn opt_len(&mut self) -> Option<usize>
[src]
Internal method used to define the behavior of this parallel iterator. You should not need to call this directly. Read more
fn weight(self, _scale: f64) -> Weight<Self>
[src]
: try with_min_len
or with_max_len
instead
Deprecated. If the adaptive algorithms don't split appropriately, try IndexedParallelIterator::with_min_len()
or with_max_len()
instead. Read more
fn weight_max(self) -> Weight<Self>
[src]
: try with_min_len
or with_max_len
instead
Deprecated. If the adaptive algorithms don't split appropriately, try IndexedParallelIterator::with_min_len()
or with_max_len()
instead. Read more
fn for_each<OP>(self, op: OP) where
OP: Fn(Self::Item) + Sync,
[src]
OP: Fn(Self::Item) + Sync,
Executes OP
on each item produced by the iterator, in parallel.
fn count(self) -> usize
[src]
Counts the number of items in this parallel iterator.
fn map<F, R>(self, map_op: F) -> Map<Self, MapFn<F>> where
F: Fn(Self::Item) -> R + Sync,
R: Send,
[src]
F: Fn(Self::Item) -> R + Sync,
R: Send,
Applies map_op
to each item of this iterator, producing a new iterator with the results. Read more
fn cloned<'a, T>(self) -> Map<Self, MapCloned> where
T: 'a + Clone + Send,
Self: ParallelIterator<Item = &'a T>,
[src]
T: 'a + Clone + Send,
Self: ParallelIterator<Item = &'a T>,
Creates an iterator which clones all of its elements. This may be useful when you have an iterator over &T
, but you need T
. Read more
fn inspect<OP>(self, inspect_op: OP) -> Map<Self, MapInspect<OP>> where
OP: Fn(&Self::Item) + Sync,
[src]
OP: Fn(&Self::Item) + Sync,
Applies inspect_op
to a reference to each item of this iterator, producing a new iterator passing through the original items. This is often useful for debugging to see what's happening in iterator stages. Read more
fn filter<P>(self, filter_op: P) -> Filter<Self, P> where
P: Fn(&Self::Item) -> bool + Sync,
[src]
P: Fn(&Self::Item) -> bool + Sync,
Applies filter_op
to each item of this iterator, producing a new iterator with only the items that gave true
results. Read more
fn filter_map<P, R>(self, filter_op: P) -> FilterMap<Self, P> where
P: Fn(Self::Item) -> Option<R> + Sync,
R: Send,
[src]
P: Fn(Self::Item) -> Option<R> + Sync,
R: Send,
Applies filter_op
to each item of this iterator to get an Option
, producing a new iterator with only the items from Some
results. Read more
fn flat_map<F, PI>(self, map_op: F) -> FlatMap<Self, F> where
F: Fn(Self::Item) -> PI + Sync,
PI: IntoParallelIterator,
[src]
F: Fn(Self::Item) -> PI + Sync,
PI: IntoParallelIterator,
Applies map_op
to each item of this iterator to get nested iterators, producing a new iterator that flattens these back into one. Read more
fn reduce<OP, ID>(self, identity: ID, op: OP) -> Self::Item where
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
ID: Fn() -> Self::Item + Sync,
[src]
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
ID: Fn() -> Self::Item + Sync,
Reduces the items in the iterator into one item using op
. The argument identity
should be a closure that can produce "identity" value which may be inserted into the sequence as needed to create opportunities for parallel execution. So, for example, if you are doing a summation, then identity()
ought to produce something that represents the zero for your type (but consider just calling sum()
in that case). Read more
fn reduce_with<OP>(self, op: OP) -> Option<Self::Item> where
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
[src]
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
Reduces the items in the iterator into one item using op
. If the iterator is empty, None
is returned; otherwise, Some
is returned. Read more
fn reduce_with_identity<OP>(self, identity: Self::Item, op: OP) -> Self::Item where
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
Self::Item: Clone + Sync,
[src]
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
Self::Item: Clone + Sync,
: call reduce
instead
Deprecated. Use reduce()
instead.
fn fold<T, ID, F>(self, identity: ID, fold_op: F) -> Fold<Self, ID, F> where
F: Fn(T, Self::Item) -> T + Sync,
ID: Fn() -> T + Sync,
T: Send,
[src]
F: Fn(T, Self::Item) -> T + Sync,
ID: Fn() -> T + Sync,
T: Send,
Parallel fold is similar to sequential fold except that the sequence of items may be subdivided before it is folded. Consider a list of numbers like 22 3 77 89 46
. If you used sequential fold to add them (fold(0, |a,b| a+b)
, you would wind up first adding 0 + 22, then 22 + 3, then 25 + 77, and so forth. The parallel fold works similarly except that it first breaks up your list into sublists, and hence instead of yielding up a single sum at the end, it yields up multiple sums. The number of results is nondeterministic, as is the point where the breaks occur. Read more
fn sum<S>(self) -> S where
S: Send + Sum<Self::Item> + Sum,
[src]
S: Send + Sum<Self::Item> + Sum,
Sums up the items in the iterator. Read more
fn product<P>(self) -> P where
P: Send + Product<Self::Item> + Product,
[src]
P: Send + Product<Self::Item> + Product,
Multiplies all the items in the iterator. Read more
fn mul(self) -> Self::Item where
Self::Item: Product,
[src]
Self::Item: Product,
: name changed to product()
to match sequential iterators
DEPRECATED
fn min(self) -> Option<Self::Item> where
Self::Item: Ord,
[src]
Self::Item: Ord,
Computes the minimum of all the items in the iterator. If the iterator is empty, None
is returned; otherwise, Some(min)
is returned. Read more
fn min_by_key<K, F>(self, f: F) -> Option<Self::Item> where
K: Ord + Send,
F: Sync + Fn(&Self::Item) -> K,
[src]
K: Ord + Send,
F: Sync + Fn(&Self::Item) -> K,
Computes the item that yields the minimum value for the given function. If the iterator is empty, None
is returned; otherwise, Some(item)
is returned. Read more
fn max(self) -> Option<Self::Item> where
Self::Item: Ord,
[src]
Self::Item: Ord,
Computes the maximum of all the items in the iterator. If the iterator is empty, None
is returned; otherwise, Some(max)
is returned. Read more
fn max_by_key<K, F>(self, f: F) -> Option<Self::Item> where
K: Ord + Send,
F: Sync + Fn(&Self::Item) -> K,
[src]
K: Ord + Send,
F: Sync + Fn(&Self::Item) -> K,
Computes the item that yields the maximum value for the given function. If the iterator is empty, None
is returned; otherwise, Some(item)
is returned. Read more
fn chain<C>(self, chain: C) -> Chain<Self, C::Iter> where
C: IntoParallelIterator<Item = Self::Item>,
[src]
C: IntoParallelIterator<Item = Self::Item>,
Takes two iterators and creates a new iterator over both.
fn find_any<P>(self, predicate: P) -> Option<Self::Item> where
P: Fn(&Self::Item) -> bool + Sync,
[src]
P: Fn(&Self::Item) -> bool + Sync,
Searches for some item in the parallel iterator that matches the given predicate and returns it. This operation is similar to [find
on sequential iterators][find] but the item returned may not be the first one in the parallel sequence which matches, since we search the entire sequence in parallel. Read more
fn find_first<P>(self, predicate: P) -> Option<Self::Item> where
P: Fn(&Self::Item) -> bool + Sync,
[src]
P: Fn(&Self::Item) -> bool + Sync,
Searches for the first item in the parallel iterator that matches the given predicate and returns it. Read more
fn find_last<P>(self, predicate: P) -> Option<Self::Item> where
P: Fn(&Self::Item) -> bool + Sync,
[src]
P: Fn(&Self::Item) -> bool + Sync,
Searches for the last item in the parallel iterator that matches the given predicate and returns it. Read more
fn any<P>(self, predicate: P) -> bool where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Searches for some item in the parallel iterator that matches the given predicate, and if so returns true. Once a match is found, we'll attempt to stop process the rest of the items. Proving that there's no match, returning false, does require visiting every item. Read more
fn all<P>(self, predicate: P) -> bool where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Tests that every item in the parallel iterator matches the given predicate, and if so returns true. If a counter-example is found, we'll attempt to stop processing more items, then return false. Read more
fn collect<C>(self) -> C where
C: FromParallelIterator<Self::Item>,
[src]
C: FromParallelIterator<Self::Item>,
Create a fresh collection containing all the element produced by this parallel iterator. Read more
impl BoundedParallelIterator for Iter<u16>
[src]
fn upper_bound(&mut self) -> usize
[src]
fn drive<C>(self, consumer: C) -> C::Result where
C: Consumer<Self::Item>,
[src]
C: Consumer<Self::Item>,
Internal method used to define the behavior of this parallel iterator. You should not need to call this directly. Read more
impl ExactParallelIterator for Iter<u16>
[src]
fn len(&mut self) -> usize
[src]
Produces an exact count of how many items this iterator will produce, presuming no panic occurs. Read more
fn collect_into(self, target: &mut Vec<Self::Item>)
[src]
Collects the results of the iterator into the specified vector. The vector is always truncated before execution begins. If possible, reusing the vector across calls can lead to better performance since it reuses the same backing buffer. Read more
impl IndexedParallelIterator for Iter<u16>
[src]
fn with_producer<CB>(self, callback: CB) -> CB::Output where
CB: ProducerCallback<Self::Item>,
[src]
CB: ProducerCallback<Self::Item>,
Internal method used to define the behavior of this parallel iterator. You should not need to call this directly. Read more
fn zip<Z>(self, zip_op: Z) -> Zip<Self, Z::Iter> where
Z: IntoParallelIterator,
Z::Iter: IndexedParallelIterator,
[src]
Z: IntoParallelIterator,
Z::Iter: IndexedParallelIterator,
Iterate over tuples (A, B)
, where the items A
are from this iterator and B
are from the iterator given as argument. Like the zip
method on ordinary iterators, if the two iterators are of unequal length, you only get the items they have in common. Read more
fn cmp<I>(self, other: I) -> Ordering where
I: IntoParallelIterator<Item = Self::Item>,
I::Iter: IndexedParallelIterator,
Self::Item: Ord,
[src]
I: IntoParallelIterator<Item = Self::Item>,
I::Iter: IndexedParallelIterator,
Self::Item: Ord,
Lexicographically compares the elements of this ParallelIterator
with those of another. Read more
fn partial_cmp<I>(self, other: I) -> Option<Ordering> where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
Lexicographically compares the elements of this ParallelIterator
with those of another. Read more
fn eq<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialEq<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialEq<I::Item>,
Determines if the elements of this ParallelIterator
are equal to those of another Read more
fn ne<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialEq<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialEq<I::Item>,
Determines if the elements of this ParallelIterator
are unequal to those of another Read more
fn lt<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
Determines if the elements of this ParallelIterator
are lexicographically less than those of another. Read more
fn le<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
Determines if the elements of this ParallelIterator
are less or equal to those of another. Read more
fn gt<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
Determines if the elements of this ParallelIterator
are lexicographically greater than those of another. Read more
fn ge<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
Determines if the elements of this ParallelIterator
are less or equal to those of another. Read more
fn enumerate(self) -> Enumerate<Self>
[src]
Yields an index along with each item.
fn skip(self, n: usize) -> Skip<Self>
[src]
Creates an iterator that skips the first n
elements.
fn take(self, n: usize) -> Take<Self>
[src]
Creates an iterator that yields the first n
elements.
fn position_any<P>(self, predicate: P) -> Option<usize> where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Searches for some item in the parallel iterator that matches the given predicate, and returns its index. Like ParallelIterator::find_any
, the parallel search will not necessarily find the first match, and once a match is found we'll attempt to stop processing any more. Read more
fn position_first<P>(self, predicate: P) -> Option<usize> where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Searches for the first item in the parallel iterator that matches the given predicate, and returns its index. Read more
fn position_last<P>(self, predicate: P) -> Option<usize> where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Searches for the last item in the parallel iterator that matches the given predicate, and returns its index. Read more
fn rev(self) -> Rev<Self>
[src]
Produces a new iterator with the elements of this iterator in reverse order. Read more
fn with_min_len(self, min: usize) -> MinLen<Self>
[src]
Sets the minimum length of iterators desired to process in each thread. Rayon will not split any smaller than this length, but of course an iterator could already be smaller to begin with. Read more
fn with_max_len(self, max: usize) -> MaxLen<Self>
[src]
Sets the maximum length of iterators desired to process in each thread. Rayon will try to split at least below this length, unless that would put it below the length from with_min_len()
. For example, given min=10 and max=15, a length of 16 will not be split any further. Read more
impl ParallelIterator for Iter<u32>
[src]
type Item = u32
fn drive_unindexed<C>(self, consumer: C) -> C::Result where
C: UnindexedConsumer<Self::Item>,
[src]
C: UnindexedConsumer<Self::Item>,
Internal method used to define the behavior of this parallel iterator. You should not need to call this directly. Read more
fn opt_len(&mut self) -> Option<usize>
[src]
Internal method used to define the behavior of this parallel iterator. You should not need to call this directly. Read more
fn weight(self, _scale: f64) -> Weight<Self>
[src]
: try with_min_len
or with_max_len
instead
Deprecated. If the adaptive algorithms don't split appropriately, try IndexedParallelIterator::with_min_len()
or with_max_len()
instead. Read more
fn weight_max(self) -> Weight<Self>
[src]
: try with_min_len
or with_max_len
instead
Deprecated. If the adaptive algorithms don't split appropriately, try IndexedParallelIterator::with_min_len()
or with_max_len()
instead. Read more
fn for_each<OP>(self, op: OP) where
OP: Fn(Self::Item) + Sync,
[src]
OP: Fn(Self::Item) + Sync,
Executes OP
on each item produced by the iterator, in parallel.
fn count(self) -> usize
[src]
Counts the number of items in this parallel iterator.
fn map<F, R>(self, map_op: F) -> Map<Self, MapFn<F>> where
F: Fn(Self::Item) -> R + Sync,
R: Send,
[src]
F: Fn(Self::Item) -> R + Sync,
R: Send,
Applies map_op
to each item of this iterator, producing a new iterator with the results. Read more
fn cloned<'a, T>(self) -> Map<Self, MapCloned> where
T: 'a + Clone + Send,
Self: ParallelIterator<Item = &'a T>,
[src]
T: 'a + Clone + Send,
Self: ParallelIterator<Item = &'a T>,
Creates an iterator which clones all of its elements. This may be useful when you have an iterator over &T
, but you need T
. Read more
fn inspect<OP>(self, inspect_op: OP) -> Map<Self, MapInspect<OP>> where
OP: Fn(&Self::Item) + Sync,
[src]
OP: Fn(&Self::Item) + Sync,
Applies inspect_op
to a reference to each item of this iterator, producing a new iterator passing through the original items. This is often useful for debugging to see what's happening in iterator stages. Read more
fn filter<P>(self, filter_op: P) -> Filter<Self, P> where
P: Fn(&Self::Item) -> bool + Sync,
[src]
P: Fn(&Self::Item) -> bool + Sync,
Applies filter_op
to each item of this iterator, producing a new iterator with only the items that gave true
results. Read more
fn filter_map<P, R>(self, filter_op: P) -> FilterMap<Self, P> where
P: Fn(Self::Item) -> Option<R> + Sync,
R: Send,
[src]
P: Fn(Self::Item) -> Option<R> + Sync,
R: Send,
Applies filter_op
to each item of this iterator to get an Option
, producing a new iterator with only the items from Some
results. Read more
fn flat_map<F, PI>(self, map_op: F) -> FlatMap<Self, F> where
F: Fn(Self::Item) -> PI + Sync,
PI: IntoParallelIterator,
[src]
F: Fn(Self::Item) -> PI + Sync,
PI: IntoParallelIterator,
Applies map_op
to each item of this iterator to get nested iterators, producing a new iterator that flattens these back into one. Read more
fn reduce<OP, ID>(self, identity: ID, op: OP) -> Self::Item where
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
ID: Fn() -> Self::Item + Sync,
[src]
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
ID: Fn() -> Self::Item + Sync,
Reduces the items in the iterator into one item using op
. The argument identity
should be a closure that can produce "identity" value which may be inserted into the sequence as needed to create opportunities for parallel execution. So, for example, if you are doing a summation, then identity()
ought to produce something that represents the zero for your type (but consider just calling sum()
in that case). Read more
fn reduce_with<OP>(self, op: OP) -> Option<Self::Item> where
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
[src]
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
Reduces the items in the iterator into one item using op
. If the iterator is empty, None
is returned; otherwise, Some
is returned. Read more
fn reduce_with_identity<OP>(self, identity: Self::Item, op: OP) -> Self::Item where
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
Self::Item: Clone + Sync,
[src]
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
Self::Item: Clone + Sync,
: call reduce
instead
Deprecated. Use reduce()
instead.
fn fold<T, ID, F>(self, identity: ID, fold_op: F) -> Fold<Self, ID, F> where
F: Fn(T, Self::Item) -> T + Sync,
ID: Fn() -> T + Sync,
T: Send,
[src]
F: Fn(T, Self::Item) -> T + Sync,
ID: Fn() -> T + Sync,
T: Send,
Parallel fold is similar to sequential fold except that the sequence of items may be subdivided before it is folded. Consider a list of numbers like 22 3 77 89 46
. If you used sequential fold to add them (fold(0, |a,b| a+b)
, you would wind up first adding 0 + 22, then 22 + 3, then 25 + 77, and so forth. The parallel fold works similarly except that it first breaks up your list into sublists, and hence instead of yielding up a single sum at the end, it yields up multiple sums. The number of results is nondeterministic, as is the point where the breaks occur. Read more
fn sum<S>(self) -> S where
S: Send + Sum<Self::Item> + Sum,
[src]
S: Send + Sum<Self::Item> + Sum,
Sums up the items in the iterator. Read more
fn product<P>(self) -> P where
P: Send + Product<Self::Item> + Product,
[src]
P: Send + Product<Self::Item> + Product,
Multiplies all the items in the iterator. Read more
fn mul(self) -> Self::Item where
Self::Item: Product,
[src]
Self::Item: Product,
: name changed to product()
to match sequential iterators
DEPRECATED
fn min(self) -> Option<Self::Item> where
Self::Item: Ord,
[src]
Self::Item: Ord,
Computes the minimum of all the items in the iterator. If the iterator is empty, None
is returned; otherwise, Some(min)
is returned. Read more
fn min_by_key<K, F>(self, f: F) -> Option<Self::Item> where
K: Ord + Send,
F: Sync + Fn(&Self::Item) -> K,
[src]
K: Ord + Send,
F: Sync + Fn(&Self::Item) -> K,
Computes the item that yields the minimum value for the given function. If the iterator is empty, None
is returned; otherwise, Some(item)
is returned. Read more
fn max(self) -> Option<Self::Item> where
Self::Item: Ord,
[src]
Self::Item: Ord,
Computes the maximum of all the items in the iterator. If the iterator is empty, None
is returned; otherwise, Some(max)
is returned. Read more
fn max_by_key<K, F>(self, f: F) -> Option<Self::Item> where
K: Ord + Send,
F: Sync + Fn(&Self::Item) -> K,
[src]
K: Ord + Send,
F: Sync + Fn(&Self::Item) -> K,
Computes the item that yields the maximum value for the given function. If the iterator is empty, None
is returned; otherwise, Some(item)
is returned. Read more
fn chain<C>(self, chain: C) -> Chain<Self, C::Iter> where
C: IntoParallelIterator<Item = Self::Item>,
[src]
C: IntoParallelIterator<Item = Self::Item>,
Takes two iterators and creates a new iterator over both.
fn find_any<P>(self, predicate: P) -> Option<Self::Item> where
P: Fn(&Self::Item) -> bool + Sync,
[src]
P: Fn(&Self::Item) -> bool + Sync,
Searches for some item in the parallel iterator that matches the given predicate and returns it. This operation is similar to [find
on sequential iterators][find] but the item returned may not be the first one in the parallel sequence which matches, since we search the entire sequence in parallel. Read more
fn find_first<P>(self, predicate: P) -> Option<Self::Item> where
P: Fn(&Self::Item) -> bool + Sync,
[src]
P: Fn(&Self::Item) -> bool + Sync,
Searches for the first item in the parallel iterator that matches the given predicate and returns it. Read more
fn find_last<P>(self, predicate: P) -> Option<Self::Item> where
P: Fn(&Self::Item) -> bool + Sync,
[src]
P: Fn(&Self::Item) -> bool + Sync,
Searches for the last item in the parallel iterator that matches the given predicate and returns it. Read more
fn any<P>(self, predicate: P) -> bool where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Searches for some item in the parallel iterator that matches the given predicate, and if so returns true. Once a match is found, we'll attempt to stop process the rest of the items. Proving that there's no match, returning false, does require visiting every item. Read more
fn all<P>(self, predicate: P) -> bool where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Tests that every item in the parallel iterator matches the given predicate, and if so returns true. If a counter-example is found, we'll attempt to stop processing more items, then return false. Read more
fn collect<C>(self) -> C where
C: FromParallelIterator<Self::Item>,
[src]
C: FromParallelIterator<Self::Item>,
Create a fresh collection containing all the element produced by this parallel iterator. Read more
impl BoundedParallelIterator for Iter<u32>
[src]
fn upper_bound(&mut self) -> usize
[src]
fn drive<C>(self, consumer: C) -> C::Result where
C: Consumer<Self::Item>,
[src]
C: Consumer<Self::Item>,
Internal method used to define the behavior of this parallel iterator. You should not need to call this directly. Read more
impl ExactParallelIterator for Iter<u32>
[src]
fn len(&mut self) -> usize
[src]
Produces an exact count of how many items this iterator will produce, presuming no panic occurs. Read more
fn collect_into(self, target: &mut Vec<Self::Item>)
[src]
Collects the results of the iterator into the specified vector. The vector is always truncated before execution begins. If possible, reusing the vector across calls can lead to better performance since it reuses the same backing buffer. Read more
impl IndexedParallelIterator for Iter<u32>
[src]
fn with_producer<CB>(self, callback: CB) -> CB::Output where
CB: ProducerCallback<Self::Item>,
[src]
CB: ProducerCallback<Self::Item>,
Internal method used to define the behavior of this parallel iterator. You should not need to call this directly. Read more
fn zip<Z>(self, zip_op: Z) -> Zip<Self, Z::Iter> where
Z: IntoParallelIterator,
Z::Iter: IndexedParallelIterator,
[src]
Z: IntoParallelIterator,
Z::Iter: IndexedParallelIterator,
Iterate over tuples (A, B)
, where the items A
are from this iterator and B
are from the iterator given as argument. Like the zip
method on ordinary iterators, if the two iterators are of unequal length, you only get the items they have in common. Read more
fn cmp<I>(self, other: I) -> Ordering where
I: IntoParallelIterator<Item = Self::Item>,
I::Iter: IndexedParallelIterator,
Self::Item: Ord,
[src]
I: IntoParallelIterator<Item = Self::Item>,
I::Iter: IndexedParallelIterator,
Self::Item: Ord,
Lexicographically compares the elements of this ParallelIterator
with those of another. Read more
fn partial_cmp<I>(self, other: I) -> Option<Ordering> where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
Lexicographically compares the elements of this ParallelIterator
with those of another. Read more
fn eq<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialEq<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialEq<I::Item>,
Determines if the elements of this ParallelIterator
are equal to those of another Read more
fn ne<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialEq<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialEq<I::Item>,
Determines if the elements of this ParallelIterator
are unequal to those of another Read more
fn lt<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
Determines if the elements of this ParallelIterator
are lexicographically less than those of another. Read more
fn le<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
Determines if the elements of this ParallelIterator
are less or equal to those of another. Read more
fn gt<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
Determines if the elements of this ParallelIterator
are lexicographically greater than those of another. Read more
fn ge<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
Determines if the elements of this ParallelIterator
are less or equal to those of another. Read more
fn enumerate(self) -> Enumerate<Self>
[src]
Yields an index along with each item.
fn skip(self, n: usize) -> Skip<Self>
[src]
Creates an iterator that skips the first n
elements.
fn take(self, n: usize) -> Take<Self>
[src]
Creates an iterator that yields the first n
elements.
fn position_any<P>(self, predicate: P) -> Option<usize> where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Searches for some item in the parallel iterator that matches the given predicate, and returns its index. Like ParallelIterator::find_any
, the parallel search will not necessarily find the first match, and once a match is found we'll attempt to stop processing any more. Read more
fn position_first<P>(self, predicate: P) -> Option<usize> where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Searches for the first item in the parallel iterator that matches the given predicate, and returns its index. Read more
fn position_last<P>(self, predicate: P) -> Option<usize> where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Searches for the last item in the parallel iterator that matches the given predicate, and returns its index. Read more
fn rev(self) -> Rev<Self>
[src]
Produces a new iterator with the elements of this iterator in reverse order. Read more
fn with_min_len(self, min: usize) -> MinLen<Self>
[src]
Sets the minimum length of iterators desired to process in each thread. Rayon will not split any smaller than this length, but of course an iterator could already be smaller to begin with. Read more
fn with_max_len(self, max: usize) -> MaxLen<Self>
[src]
Sets the maximum length of iterators desired to process in each thread. Rayon will try to split at least below this length, unless that would put it below the length from with_min_len()
. For example, given min=10 and max=15, a length of 16 will not be split any further. Read more
impl ParallelIterator for Iter<usize>
[src]
type Item = usize
fn drive_unindexed<C>(self, consumer: C) -> C::Result where
C: UnindexedConsumer<Self::Item>,
[src]
C: UnindexedConsumer<Self::Item>,
Internal method used to define the behavior of this parallel iterator. You should not need to call this directly. Read more
fn opt_len(&mut self) -> Option<usize>
[src]
Internal method used to define the behavior of this parallel iterator. You should not need to call this directly. Read more
fn weight(self, _scale: f64) -> Weight<Self>
[src]
: try with_min_len
or with_max_len
instead
Deprecated. If the adaptive algorithms don't split appropriately, try IndexedParallelIterator::with_min_len()
or with_max_len()
instead. Read more
fn weight_max(self) -> Weight<Self>
[src]
: try with_min_len
or with_max_len
instead
Deprecated. If the adaptive algorithms don't split appropriately, try IndexedParallelIterator::with_min_len()
or with_max_len()
instead. Read more
fn for_each<OP>(self, op: OP) where
OP: Fn(Self::Item) + Sync,
[src]
OP: Fn(Self::Item) + Sync,
Executes OP
on each item produced by the iterator, in parallel.
fn count(self) -> usize
[src]
Counts the number of items in this parallel iterator.
fn map<F, R>(self, map_op: F) -> Map<Self, MapFn<F>> where
F: Fn(Self::Item) -> R + Sync,
R: Send,
[src]
F: Fn(Self::Item) -> R + Sync,
R: Send,
Applies map_op
to each item of this iterator, producing a new iterator with the results. Read more
fn cloned<'a, T>(self) -> Map<Self, MapCloned> where
T: 'a + Clone + Send,
Self: ParallelIterator<Item = &'a T>,
[src]
T: 'a + Clone + Send,
Self: ParallelIterator<Item = &'a T>,
Creates an iterator which clones all of its elements. This may be useful when you have an iterator over &T
, but you need T
. Read more
fn inspect<OP>(self, inspect_op: OP) -> Map<Self, MapInspect<OP>> where
OP: Fn(&Self::Item) + Sync,
[src]
OP: Fn(&Self::Item) + Sync,
Applies inspect_op
to a reference to each item of this iterator, producing a new iterator passing through the original items. This is often useful for debugging to see what's happening in iterator stages. Read more
fn filter<P>(self, filter_op: P) -> Filter<Self, P> where
P: Fn(&Self::Item) -> bool + Sync,
[src]
P: Fn(&Self::Item) -> bool + Sync,
Applies filter_op
to each item of this iterator, producing a new iterator with only the items that gave true
results. Read more
fn filter_map<P, R>(self, filter_op: P) -> FilterMap<Self, P> where
P: Fn(Self::Item) -> Option<R> + Sync,
R: Send,
[src]
P: Fn(Self::Item) -> Option<R> + Sync,
R: Send,
Applies filter_op
to each item of this iterator to get an Option
, producing a new iterator with only the items from Some
results. Read more
fn flat_map<F, PI>(self, map_op: F) -> FlatMap<Self, F> where
F: Fn(Self::Item) -> PI + Sync,
PI: IntoParallelIterator,
[src]
F: Fn(Self::Item) -> PI + Sync,
PI: IntoParallelIterator,
Applies map_op
to each item of this iterator to get nested iterators, producing a new iterator that flattens these back into one. Read more
fn reduce<OP, ID>(self, identity: ID, op: OP) -> Self::Item where
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
ID: Fn() -> Self::Item + Sync,
[src]
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
ID: Fn() -> Self::Item + Sync,
Reduces the items in the iterator into one item using op
. The argument identity
should be a closure that can produce "identity" value which may be inserted into the sequence as needed to create opportunities for parallel execution. So, for example, if you are doing a summation, then identity()
ought to produce something that represents the zero for your type (but consider just calling sum()
in that case). Read more
fn reduce_with<OP>(self, op: OP) -> Option<Self::Item> where
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
[src]
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
Reduces the items in the iterator into one item using op
. If the iterator is empty, None
is returned; otherwise, Some
is returned. Read more
fn reduce_with_identity<OP>(self, identity: Self::Item, op: OP) -> Self::Item where
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
Self::Item: Clone + Sync,
[src]
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
Self::Item: Clone + Sync,
: call reduce
instead
Deprecated. Use reduce()
instead.
fn fold<T, ID, F>(self, identity: ID, fold_op: F) -> Fold<Self, ID, F> where
F: Fn(T, Self::Item) -> T + Sync,
ID: Fn() -> T + Sync,
T: Send,
[src]
F: Fn(T, Self::Item) -> T + Sync,
ID: Fn() -> T + Sync,
T: Send,
Parallel fold is similar to sequential fold except that the sequence of items may be subdivided before it is folded. Consider a list of numbers like 22 3 77 89 46
. If you used sequential fold to add them (fold(0, |a,b| a+b)
, you would wind up first adding 0 + 22, then 22 + 3, then 25 + 77, and so forth. The parallel fold works similarly except that it first breaks up your list into sublists, and hence instead of yielding up a single sum at the end, it yields up multiple sums. The number of results is nondeterministic, as is the point where the breaks occur. Read more
fn sum<S>(self) -> S where
S: Send + Sum<Self::Item> + Sum,
[src]
S: Send + Sum<Self::Item> + Sum,
Sums up the items in the iterator. Read more
fn product<P>(self) -> P where
P: Send + Product<Self::Item> + Product,
[src]
P: Send + Product<Self::Item> + Product,
Multiplies all the items in the iterator. Read more
fn mul(self) -> Self::Item where
Self::Item: Product,
[src]
Self::Item: Product,
: name changed to product()
to match sequential iterators
DEPRECATED
fn min(self) -> Option<Self::Item> where
Self::Item: Ord,
[src]
Self::Item: Ord,
Computes the minimum of all the items in the iterator. If the iterator is empty, None
is returned; otherwise, Some(min)
is returned. Read more
fn min_by_key<K, F>(self, f: F) -> Option<Self::Item> where
K: Ord + Send,
F: Sync + Fn(&Self::Item) -> K,
[src]
K: Ord + Send,
F: Sync + Fn(&Self::Item) -> K,
Computes the item that yields the minimum value for the given function. If the iterator is empty, None
is returned; otherwise, Some(item)
is returned. Read more
fn max(self) -> Option<Self::Item> where
Self::Item: Ord,
[src]
Self::Item: Ord,
Computes the maximum of all the items in the iterator. If the iterator is empty, None
is returned; otherwise, Some(max)
is returned. Read more
fn max_by_key<K, F>(self, f: F) -> Option<Self::Item> where
K: Ord + Send,
F: Sync + Fn(&Self::Item) -> K,
[src]
K: Ord + Send,
F: Sync + Fn(&Self::Item) -> K,
Computes the item that yields the maximum value for the given function. If the iterator is empty, None
is returned; otherwise, Some(item)
is returned. Read more
fn chain<C>(self, chain: C) -> Chain<Self, C::Iter> where
C: IntoParallelIterator<Item = Self::Item>,
[src]
C: IntoParallelIterator<Item = Self::Item>,
Takes two iterators and creates a new iterator over both.
fn find_any<P>(self, predicate: P) -> Option<Self::Item> where
P: Fn(&Self::Item) -> bool + Sync,
[src]
P: Fn(&Self::Item) -> bool + Sync,
Searches for some item in the parallel iterator that matches the given predicate and returns it. This operation is similar to [find
on sequential iterators][find] but the item returned may not be the first one in the parallel sequence which matches, since we search the entire sequence in parallel. Read more
fn find_first<P>(self, predicate: P) -> Option<Self::Item> where
P: Fn(&Self::Item) -> bool + Sync,
[src]
P: Fn(&Self::Item) -> bool + Sync,
Searches for the first item in the parallel iterator that matches the given predicate and returns it. Read more
fn find_last<P>(self, predicate: P) -> Option<Self::Item> where
P: Fn(&Self::Item) -> bool + Sync,
[src]
P: Fn(&Self::Item) -> bool + Sync,
Searches for the last item in the parallel iterator that matches the given predicate and returns it. Read more
fn any<P>(self, predicate: P) -> bool where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Searches for some item in the parallel iterator that matches the given predicate, and if so returns true. Once a match is found, we'll attempt to stop process the rest of the items. Proving that there's no match, returning false, does require visiting every item. Read more
fn all<P>(self, predicate: P) -> bool where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Tests that every item in the parallel iterator matches the given predicate, and if so returns true. If a counter-example is found, we'll attempt to stop processing more items, then return false. Read more
fn collect<C>(self) -> C where
C: FromParallelIterator<Self::Item>,
[src]
C: FromParallelIterator<Self::Item>,
Create a fresh collection containing all the element produced by this parallel iterator. Read more
impl BoundedParallelIterator for Iter<usize>
[src]
fn upper_bound(&mut self) -> usize
[src]
fn drive<C>(self, consumer: C) -> C::Result where
C: Consumer<Self::Item>,
[src]
C: Consumer<Self::Item>,
Internal method used to define the behavior of this parallel iterator. You should not need to call this directly. Read more
impl ExactParallelIterator for Iter<usize>
[src]
fn len(&mut self) -> usize
[src]
Produces an exact count of how many items this iterator will produce, presuming no panic occurs. Read more
fn collect_into(self, target: &mut Vec<Self::Item>)
[src]
Collects the results of the iterator into the specified vector. The vector is always truncated before execution begins. If possible, reusing the vector across calls can lead to better performance since it reuses the same backing buffer. Read more
impl IndexedParallelIterator for Iter<usize>
[src]
fn with_producer<CB>(self, callback: CB) -> CB::Output where
CB: ProducerCallback<Self::Item>,
[src]
CB: ProducerCallback<Self::Item>,
Internal method used to define the behavior of this parallel iterator. You should not need to call this directly. Read more
fn zip<Z>(self, zip_op: Z) -> Zip<Self, Z::Iter> where
Z: IntoParallelIterator,
Z::Iter: IndexedParallelIterator,
[src]
Z: IntoParallelIterator,
Z::Iter: IndexedParallelIterator,
Iterate over tuples (A, B)
, where the items A
are from this iterator and B
are from the iterator given as argument. Like the zip
method on ordinary iterators, if the two iterators are of unequal length, you only get the items they have in common. Read more
fn cmp<I>(self, other: I) -> Ordering where
I: IntoParallelIterator<Item = Self::Item>,
I::Iter: IndexedParallelIterator,
Self::Item: Ord,
[src]
I: IntoParallelIterator<Item = Self::Item>,
I::Iter: IndexedParallelIterator,
Self::Item: Ord,
Lexicographically compares the elements of this ParallelIterator
with those of another. Read more
fn partial_cmp<I>(self, other: I) -> Option<Ordering> where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
Lexicographically compares the elements of this ParallelIterator
with those of another. Read more
fn eq<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialEq<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialEq<I::Item>,
Determines if the elements of this ParallelIterator
are equal to those of another Read more
fn ne<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialEq<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialEq<I::Item>,
Determines if the elements of this ParallelIterator
are unequal to those of another Read more
fn lt<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
Determines if the elements of this ParallelIterator
are lexicographically less than those of another. Read more
fn le<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
Determines if the elements of this ParallelIterator
are less or equal to those of another. Read more
fn gt<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
Determines if the elements of this ParallelIterator
are lexicographically greater than those of another. Read more
fn ge<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
Determines if the elements of this ParallelIterator
are less or equal to those of another. Read more
fn enumerate(self) -> Enumerate<Self>
[src]
Yields an index along with each item.
fn skip(self, n: usize) -> Skip<Self>
[src]
Creates an iterator that skips the first n
elements.
fn take(self, n: usize) -> Take<Self>
[src]
Creates an iterator that yields the first n
elements.
fn position_any<P>(self, predicate: P) -> Option<usize> where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Searches for some item in the parallel iterator that matches the given predicate, and returns its index. Like ParallelIterator::find_any
, the parallel search will not necessarily find the first match, and once a match is found we'll attempt to stop processing any more. Read more
fn position_first<P>(self, predicate: P) -> Option<usize> where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Searches for the first item in the parallel iterator that matches the given predicate, and returns its index. Read more
fn position_last<P>(self, predicate: P) -> Option<usize> where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Searches for the last item in the parallel iterator that matches the given predicate, and returns its index. Read more
fn rev(self) -> Rev<Self>
[src]
Produces a new iterator with the elements of this iterator in reverse order. Read more
fn with_min_len(self, min: usize) -> MinLen<Self>
[src]
Sets the minimum length of iterators desired to process in each thread. Rayon will not split any smaller than this length, but of course an iterator could already be smaller to begin with. Read more
fn with_max_len(self, max: usize) -> MaxLen<Self>
[src]
Sets the maximum length of iterators desired to process in each thread. Rayon will try to split at least below this length, unless that would put it below the length from with_min_len()
. For example, given min=10 and max=15, a length of 16 will not be split any further. Read more
impl ParallelIterator for Iter<i8>
[src]
type Item = i8
fn drive_unindexed<C>(self, consumer: C) -> C::Result where
C: UnindexedConsumer<Self::Item>,
[src]
C: UnindexedConsumer<Self::Item>,
Internal method used to define the behavior of this parallel iterator. You should not need to call this directly. Read more
fn opt_len(&mut self) -> Option<usize>
[src]
Internal method used to define the behavior of this parallel iterator. You should not need to call this directly. Read more
fn weight(self, _scale: f64) -> Weight<Self>
[src]
: try with_min_len
or with_max_len
instead
Deprecated. If the adaptive algorithms don't split appropriately, try IndexedParallelIterator::with_min_len()
or with_max_len()
instead. Read more
fn weight_max(self) -> Weight<Self>
[src]
: try with_min_len
or with_max_len
instead
Deprecated. If the adaptive algorithms don't split appropriately, try IndexedParallelIterator::with_min_len()
or with_max_len()
instead. Read more
fn for_each<OP>(self, op: OP) where
OP: Fn(Self::Item) + Sync,
[src]
OP: Fn(Self::Item) + Sync,
Executes OP
on each item produced by the iterator, in parallel.
fn count(self) -> usize
[src]
Counts the number of items in this parallel iterator.
fn map<F, R>(self, map_op: F) -> Map<Self, MapFn<F>> where
F: Fn(Self::Item) -> R + Sync,
R: Send,
[src]
F: Fn(Self::Item) -> R + Sync,
R: Send,
Applies map_op
to each item of this iterator, producing a new iterator with the results. Read more
fn cloned<'a, T>(self) -> Map<Self, MapCloned> where
T: 'a + Clone + Send,
Self: ParallelIterator<Item = &'a T>,
[src]
T: 'a + Clone + Send,
Self: ParallelIterator<Item = &'a T>,
Creates an iterator which clones all of its elements. This may be useful when you have an iterator over &T
, but you need T
. Read more
fn inspect<OP>(self, inspect_op: OP) -> Map<Self, MapInspect<OP>> where
OP: Fn(&Self::Item) + Sync,
[src]
OP: Fn(&Self::Item) + Sync,
Applies inspect_op
to a reference to each item of this iterator, producing a new iterator passing through the original items. This is often useful for debugging to see what's happening in iterator stages. Read more
fn filter<P>(self, filter_op: P) -> Filter<Self, P> where
P: Fn(&Self::Item) -> bool + Sync,
[src]
P: Fn(&Self::Item) -> bool + Sync,
Applies filter_op
to each item of this iterator, producing a new iterator with only the items that gave true
results. Read more
fn filter_map<P, R>(self, filter_op: P) -> FilterMap<Self, P> where
P: Fn(Self::Item) -> Option<R> + Sync,
R: Send,
[src]
P: Fn(Self::Item) -> Option<R> + Sync,
R: Send,
Applies filter_op
to each item of this iterator to get an Option
, producing a new iterator with only the items from Some
results. Read more
fn flat_map<F, PI>(self, map_op: F) -> FlatMap<Self, F> where
F: Fn(Self::Item) -> PI + Sync,
PI: IntoParallelIterator,
[src]
F: Fn(Self::Item) -> PI + Sync,
PI: IntoParallelIterator,
Applies map_op
to each item of this iterator to get nested iterators, producing a new iterator that flattens these back into one. Read more
fn reduce<OP, ID>(self, identity: ID, op: OP) -> Self::Item where
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
ID: Fn() -> Self::Item + Sync,
[src]
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
ID: Fn() -> Self::Item + Sync,
Reduces the items in the iterator into one item using op
. The argument identity
should be a closure that can produce "identity" value which may be inserted into the sequence as needed to create opportunities for parallel execution. So, for example, if you are doing a summation, then identity()
ought to produce something that represents the zero for your type (but consider just calling sum()
in that case). Read more
fn reduce_with<OP>(self, op: OP) -> Option<Self::Item> where
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
[src]
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
Reduces the items in the iterator into one item using op
. If the iterator is empty, None
is returned; otherwise, Some
is returned. Read more
fn reduce_with_identity<OP>(self, identity: Self::Item, op: OP) -> Self::Item where
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
Self::Item: Clone + Sync,
[src]
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
Self::Item: Clone + Sync,
: call reduce
instead
Deprecated. Use reduce()
instead.
fn fold<T, ID, F>(self, identity: ID, fold_op: F) -> Fold<Self, ID, F> where
F: Fn(T, Self::Item) -> T + Sync,
ID: Fn() -> T + Sync,
T: Send,
[src]
F: Fn(T, Self::Item) -> T + Sync,
ID: Fn() -> T + Sync,
T: Send,
Parallel fold is similar to sequential fold except that the sequence of items may be subdivided before it is folded. Consider a list of numbers like 22 3 77 89 46
. If you used sequential fold to add them (fold(0, |a,b| a+b)
, you would wind up first adding 0 + 22, then 22 + 3, then 25 + 77, and so forth. The parallel fold works similarly except that it first breaks up your list into sublists, and hence instead of yielding up a single sum at the end, it yields up multiple sums. The number of results is nondeterministic, as is the point where the breaks occur. Read more
fn sum<S>(self) -> S where
S: Send + Sum<Self::Item> + Sum,
[src]
S: Send + Sum<Self::Item> + Sum,
Sums up the items in the iterator. Read more
fn product<P>(self) -> P where
P: Send + Product<Self::Item> + Product,
[src]
P: Send + Product<Self::Item> + Product,
Multiplies all the items in the iterator. Read more
fn mul(self) -> Self::Item where
Self::Item: Product,
[src]
Self::Item: Product,
: name changed to product()
to match sequential iterators
DEPRECATED
fn min(self) -> Option<Self::Item> where
Self::Item: Ord,
[src]
Self::Item: Ord,
Computes the minimum of all the items in the iterator. If the iterator is empty, None
is returned; otherwise, Some(min)
is returned. Read more
fn min_by_key<K, F>(self, f: F) -> Option<Self::Item> where
K: Ord + Send,
F: Sync + Fn(&Self::Item) -> K,
[src]
K: Ord + Send,
F: Sync + Fn(&Self::Item) -> K,
Computes the item that yields the minimum value for the given function. If the iterator is empty, None
is returned; otherwise, Some(item)
is returned. Read more
fn max(self) -> Option<Self::Item> where
Self::Item: Ord,
[src]
Self::Item: Ord,
Computes the maximum of all the items in the iterator. If the iterator is empty, None
is returned; otherwise, Some(max)
is returned. Read more
fn max_by_key<K, F>(self, f: F) -> Option<Self::Item> where
K: Ord + Send,
F: Sync + Fn(&Self::Item) -> K,
[src]
K: Ord + Send,
F: Sync + Fn(&Self::Item) -> K,
Computes the item that yields the maximum value for the given function. If the iterator is empty, None
is returned; otherwise, Some(item)
is returned. Read more
fn chain<C>(self, chain: C) -> Chain<Self, C::Iter> where
C: IntoParallelIterator<Item = Self::Item>,
[src]
C: IntoParallelIterator<Item = Self::Item>,
Takes two iterators and creates a new iterator over both.
fn find_any<P>(self, predicate: P) -> Option<Self::Item> where
P: Fn(&Self::Item) -> bool + Sync,
[src]
P: Fn(&Self::Item) -> bool + Sync,
Searches for some item in the parallel iterator that matches the given predicate and returns it. This operation is similar to [find
on sequential iterators][find] but the item returned may not be the first one in the parallel sequence which matches, since we search the entire sequence in parallel. Read more
fn find_first<P>(self, predicate: P) -> Option<Self::Item> where
P: Fn(&Self::Item) -> bool + Sync,
[src]
P: Fn(&Self::Item) -> bool + Sync,
Searches for the first item in the parallel iterator that matches the given predicate and returns it. Read more
fn find_last<P>(self, predicate: P) -> Option<Self::Item> where
P: Fn(&Self::Item) -> bool + Sync,
[src]
P: Fn(&Self::Item) -> bool + Sync,
Searches for the last item in the parallel iterator that matches the given predicate and returns it. Read more
fn any<P>(self, predicate: P) -> bool where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Searches for some item in the parallel iterator that matches the given predicate, and if so returns true. Once a match is found, we'll attempt to stop process the rest of the items. Proving that there's no match, returning false, does require visiting every item. Read more
fn all<P>(self, predicate: P) -> bool where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Tests that every item in the parallel iterator matches the given predicate, and if so returns true. If a counter-example is found, we'll attempt to stop processing more items, then return false. Read more
fn collect<C>(self) -> C where
C: FromParallelIterator<Self::Item>,
[src]
C: FromParallelIterator<Self::Item>,
Create a fresh collection containing all the element produced by this parallel iterator. Read more
impl BoundedParallelIterator for Iter<i8>
[src]
fn upper_bound(&mut self) -> usize
[src]
fn drive<C>(self, consumer: C) -> C::Result where
C: Consumer<Self::Item>,
[src]
C: Consumer<Self::Item>,
Internal method used to define the behavior of this parallel iterator. You should not need to call this directly. Read more
impl ExactParallelIterator for Iter<i8>
[src]
fn len(&mut self) -> usize
[src]
Produces an exact count of how many items this iterator will produce, presuming no panic occurs. Read more
fn collect_into(self, target: &mut Vec<Self::Item>)
[src]
Collects the results of the iterator into the specified vector. The vector is always truncated before execution begins. If possible, reusing the vector across calls can lead to better performance since it reuses the same backing buffer. Read more
impl IndexedParallelIterator for Iter<i8>
[src]
fn with_producer<CB>(self, callback: CB) -> CB::Output where
CB: ProducerCallback<Self::Item>,
[src]
CB: ProducerCallback<Self::Item>,
Internal method used to define the behavior of this parallel iterator. You should not need to call this directly. Read more
fn zip<Z>(self, zip_op: Z) -> Zip<Self, Z::Iter> where
Z: IntoParallelIterator,
Z::Iter: IndexedParallelIterator,
[src]
Z: IntoParallelIterator,
Z::Iter: IndexedParallelIterator,
Iterate over tuples (A, B)
, where the items A
are from this iterator and B
are from the iterator given as argument. Like the zip
method on ordinary iterators, if the two iterators are of unequal length, you only get the items they have in common. Read more
fn cmp<I>(self, other: I) -> Ordering where
I: IntoParallelIterator<Item = Self::Item>,
I::Iter: IndexedParallelIterator,
Self::Item: Ord,
[src]
I: IntoParallelIterator<Item = Self::Item>,
I::Iter: IndexedParallelIterator,
Self::Item: Ord,
Lexicographically compares the elements of this ParallelIterator
with those of another. Read more
fn partial_cmp<I>(self, other: I) -> Option<Ordering> where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
Lexicographically compares the elements of this ParallelIterator
with those of another. Read more
fn eq<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialEq<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialEq<I::Item>,
Determines if the elements of this ParallelIterator
are equal to those of another Read more
fn ne<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialEq<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialEq<I::Item>,
Determines if the elements of this ParallelIterator
are unequal to those of another Read more
fn lt<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
Determines if the elements of this ParallelIterator
are lexicographically less than those of another. Read more
fn le<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
Determines if the elements of this ParallelIterator
are less or equal to those of another. Read more
fn gt<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
Determines if the elements of this ParallelIterator
are lexicographically greater than those of another. Read more
fn ge<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
Determines if the elements of this ParallelIterator
are less or equal to those of another. Read more
fn enumerate(self) -> Enumerate<Self>
[src]
Yields an index along with each item.
fn skip(self, n: usize) -> Skip<Self>
[src]
Creates an iterator that skips the first n
elements.
fn take(self, n: usize) -> Take<Self>
[src]
Creates an iterator that yields the first n
elements.
fn position_any<P>(self, predicate: P) -> Option<usize> where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Searches for some item in the parallel iterator that matches the given predicate, and returns its index. Like ParallelIterator::find_any
, the parallel search will not necessarily find the first match, and once a match is found we'll attempt to stop processing any more. Read more
fn position_first<P>(self, predicate: P) -> Option<usize> where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Searches for the first item in the parallel iterator that matches the given predicate, and returns its index. Read more
fn position_last<P>(self, predicate: P) -> Option<usize> where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Searches for the last item in the parallel iterator that matches the given predicate, and returns its index. Read more
fn rev(self) -> Rev<Self>
[src]
Produces a new iterator with the elements of this iterator in reverse order. Read more
fn with_min_len(self, min: usize) -> MinLen<Self>
[src]
Sets the minimum length of iterators desired to process in each thread. Rayon will not split any smaller than this length, but of course an iterator could already be smaller to begin with. Read more
fn with_max_len(self, max: usize) -> MaxLen<Self>
[src]
Sets the maximum length of iterators desired to process in each thread. Rayon will try to split at least below this length, unless that would put it below the length from with_min_len()
. For example, given min=10 and max=15, a length of 16 will not be split any further. Read more
impl ParallelIterator for Iter<i16>
[src]
type Item = i16
fn drive_unindexed<C>(self, consumer: C) -> C::Result where
C: UnindexedConsumer<Self::Item>,
[src]
C: UnindexedConsumer<Self::Item>,
Internal method used to define the behavior of this parallel iterator. You should not need to call this directly. Read more
fn opt_len(&mut self) -> Option<usize>
[src]
Internal method used to define the behavior of this parallel iterator. You should not need to call this directly. Read more
fn weight(self, _scale: f64) -> Weight<Self>
[src]
: try with_min_len
or with_max_len
instead
Deprecated. If the adaptive algorithms don't split appropriately, try IndexedParallelIterator::with_min_len()
or with_max_len()
instead. Read more
fn weight_max(self) -> Weight<Self>
[src]
: try with_min_len
or with_max_len
instead
Deprecated. If the adaptive algorithms don't split appropriately, try IndexedParallelIterator::with_min_len()
or with_max_len()
instead. Read more
fn for_each<OP>(self, op: OP) where
OP: Fn(Self::Item) + Sync,
[src]
OP: Fn(Self::Item) + Sync,
Executes OP
on each item produced by the iterator, in parallel.
fn count(self) -> usize
[src]
Counts the number of items in this parallel iterator.
fn map<F, R>(self, map_op: F) -> Map<Self, MapFn<F>> where
F: Fn(Self::Item) -> R + Sync,
R: Send,
[src]
F: Fn(Self::Item) -> R + Sync,
R: Send,
Applies map_op
to each item of this iterator, producing a new iterator with the results. Read more
fn cloned<'a, T>(self) -> Map<Self, MapCloned> where
T: 'a + Clone + Send,
Self: ParallelIterator<Item = &'a T>,
[src]
T: 'a + Clone + Send,
Self: ParallelIterator<Item = &'a T>,
Creates an iterator which clones all of its elements. This may be useful when you have an iterator over &T
, but you need T
. Read more
fn inspect<OP>(self, inspect_op: OP) -> Map<Self, MapInspect<OP>> where
OP: Fn(&Self::Item) + Sync,
[src]
OP: Fn(&Self::Item) + Sync,
Applies inspect_op
to a reference to each item of this iterator, producing a new iterator passing through the original items. This is often useful for debugging to see what's happening in iterator stages. Read more
fn filter<P>(self, filter_op: P) -> Filter<Self, P> where
P: Fn(&Self::Item) -> bool + Sync,
[src]
P: Fn(&Self::Item) -> bool + Sync,
Applies filter_op
to each item of this iterator, producing a new iterator with only the items that gave true
results. Read more
fn filter_map<P, R>(self, filter_op: P) -> FilterMap<Self, P> where
P: Fn(Self::Item) -> Option<R> + Sync,
R: Send,
[src]
P: Fn(Self::Item) -> Option<R> + Sync,
R: Send,
Applies filter_op
to each item of this iterator to get an Option
, producing a new iterator with only the items from Some
results. Read more
fn flat_map<F, PI>(self, map_op: F) -> FlatMap<Self, F> where
F: Fn(Self::Item) -> PI + Sync,
PI: IntoParallelIterator,
[src]
F: Fn(Self::Item) -> PI + Sync,
PI: IntoParallelIterator,
Applies map_op
to each item of this iterator to get nested iterators, producing a new iterator that flattens these back into one. Read more
fn reduce<OP, ID>(self, identity: ID, op: OP) -> Self::Item where
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
ID: Fn() -> Self::Item + Sync,
[src]
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
ID: Fn() -> Self::Item + Sync,
Reduces the items in the iterator into one item using op
. The argument identity
should be a closure that can produce "identity" value which may be inserted into the sequence as needed to create opportunities for parallel execution. So, for example, if you are doing a summation, then identity()
ought to produce something that represents the zero for your type (but consider just calling sum()
in that case). Read more
fn reduce_with<OP>(self, op: OP) -> Option<Self::Item> where
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
[src]
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
Reduces the items in the iterator into one item using op
. If the iterator is empty, None
is returned; otherwise, Some
is returned. Read more
fn reduce_with_identity<OP>(self, identity: Self::Item, op: OP) -> Self::Item where
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
Self::Item: Clone + Sync,
[src]
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
Self::Item: Clone + Sync,
: call reduce
instead
Deprecated. Use reduce()
instead.
fn fold<T, ID, F>(self, identity: ID, fold_op: F) -> Fold<Self, ID, F> where
F: Fn(T, Self::Item) -> T + Sync,
ID: Fn() -> T + Sync,
T: Send,
[src]
F: Fn(T, Self::Item) -> T + Sync,
ID: Fn() -> T + Sync,
T: Send,
Parallel fold is similar to sequential fold except that the sequence of items may be subdivided before it is folded. Consider a list of numbers like 22 3 77 89 46
. If you used sequential fold to add them (fold(0, |a,b| a+b)
, you would wind up first adding 0 + 22, then 22 + 3, then 25 + 77, and so forth. The parallel fold works similarly except that it first breaks up your list into sublists, and hence instead of yielding up a single sum at the end, it yields up multiple sums. The number of results is nondeterministic, as is the point where the breaks occur. Read more
fn sum<S>(self) -> S where
S: Send + Sum<Self::Item> + Sum,
[src]
S: Send + Sum<Self::Item> + Sum,
Sums up the items in the iterator. Read more
fn product<P>(self) -> P where
P: Send + Product<Self::Item> + Product,
[src]
P: Send + Product<Self::Item> + Product,
Multiplies all the items in the iterator. Read more
fn mul(self) -> Self::Item where
Self::Item: Product,
[src]
Self::Item: Product,
: name changed to product()
to match sequential iterators
DEPRECATED
fn min(self) -> Option<Self::Item> where
Self::Item: Ord,
[src]
Self::Item: Ord,
Computes the minimum of all the items in the iterator. If the iterator is empty, None
is returned; otherwise, Some(min)
is returned. Read more
fn min_by_key<K, F>(self, f: F) -> Option<Self::Item> where
K: Ord + Send,
F: Sync + Fn(&Self::Item) -> K,
[src]
K: Ord + Send,
F: Sync + Fn(&Self::Item) -> K,
Computes the item that yields the minimum value for the given function. If the iterator is empty, None
is returned; otherwise, Some(item)
is returned. Read more
fn max(self) -> Option<Self::Item> where
Self::Item: Ord,
[src]
Self::Item: Ord,
Computes the maximum of all the items in the iterator. If the iterator is empty, None
is returned; otherwise, Some(max)
is returned. Read more
fn max_by_key<K, F>(self, f: F) -> Option<Self::Item> where
K: Ord + Send,
F: Sync + Fn(&Self::Item) -> K,
[src]
K: Ord + Send,
F: Sync + Fn(&Self::Item) -> K,
Computes the item that yields the maximum value for the given function. If the iterator is empty, None
is returned; otherwise, Some(item)
is returned. Read more
fn chain<C>(self, chain: C) -> Chain<Self, C::Iter> where
C: IntoParallelIterator<Item = Self::Item>,
[src]
C: IntoParallelIterator<Item = Self::Item>,
Takes two iterators and creates a new iterator over both.
fn find_any<P>(self, predicate: P) -> Option<Self::Item> where
P: Fn(&Self::Item) -> bool + Sync,
[src]
P: Fn(&Self::Item) -> bool + Sync,
Searches for some item in the parallel iterator that matches the given predicate and returns it. This operation is similar to [find
on sequential iterators][find] but the item returned may not be the first one in the parallel sequence which matches, since we search the entire sequence in parallel. Read more
fn find_first<P>(self, predicate: P) -> Option<Self::Item> where
P: Fn(&Self::Item) -> bool + Sync,
[src]
P: Fn(&Self::Item) -> bool + Sync,
Searches for the first item in the parallel iterator that matches the given predicate and returns it. Read more
fn find_last<P>(self, predicate: P) -> Option<Self::Item> where
P: Fn(&Self::Item) -> bool + Sync,
[src]
P: Fn(&Self::Item) -> bool + Sync,
Searches for the last item in the parallel iterator that matches the given predicate and returns it. Read more
fn any<P>(self, predicate: P) -> bool where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Searches for some item in the parallel iterator that matches the given predicate, and if so returns true. Once a match is found, we'll attempt to stop process the rest of the items. Proving that there's no match, returning false, does require visiting every item. Read more
fn all<P>(self, predicate: P) -> bool where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Tests that every item in the parallel iterator matches the given predicate, and if so returns true. If a counter-example is found, we'll attempt to stop processing more items, then return false. Read more
fn collect<C>(self) -> C where
C: FromParallelIterator<Self::Item>,
[src]
C: FromParallelIterator<Self::Item>,
Create a fresh collection containing all the element produced by this parallel iterator. Read more
impl BoundedParallelIterator for Iter<i16>
[src]
fn upper_bound(&mut self) -> usize
[src]
fn drive<C>(self, consumer: C) -> C::Result where
C: Consumer<Self::Item>,
[src]
C: Consumer<Self::Item>,
Internal method used to define the behavior of this parallel iterator. You should not need to call this directly. Read more
impl ExactParallelIterator for Iter<i16>
[src]
fn len(&mut self) -> usize
[src]
Produces an exact count of how many items this iterator will produce, presuming no panic occurs. Read more
fn collect_into(self, target: &mut Vec<Self::Item>)
[src]
Collects the results of the iterator into the specified vector. The vector is always truncated before execution begins. If possible, reusing the vector across calls can lead to better performance since it reuses the same backing buffer. Read more
impl IndexedParallelIterator for Iter<i16>
[src]
fn with_producer<CB>(self, callback: CB) -> CB::Output where
CB: ProducerCallback<Self::Item>,
[src]
CB: ProducerCallback<Self::Item>,
Internal method used to define the behavior of this parallel iterator. You should not need to call this directly. Read more
fn zip<Z>(self, zip_op: Z) -> Zip<Self, Z::Iter> where
Z: IntoParallelIterator,
Z::Iter: IndexedParallelIterator,
[src]
Z: IntoParallelIterator,
Z::Iter: IndexedParallelIterator,
Iterate over tuples (A, B)
, where the items A
are from this iterator and B
are from the iterator given as argument. Like the zip
method on ordinary iterators, if the two iterators are of unequal length, you only get the items they have in common. Read more
fn cmp<I>(self, other: I) -> Ordering where
I: IntoParallelIterator<Item = Self::Item>,
I::Iter: IndexedParallelIterator,
Self::Item: Ord,
[src]
I: IntoParallelIterator<Item = Self::Item>,
I::Iter: IndexedParallelIterator,
Self::Item: Ord,
Lexicographically compares the elements of this ParallelIterator
with those of another. Read more
fn partial_cmp<I>(self, other: I) -> Option<Ordering> where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
Lexicographically compares the elements of this ParallelIterator
with those of another. Read more
fn eq<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialEq<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialEq<I::Item>,
Determines if the elements of this ParallelIterator
are equal to those of another Read more
fn ne<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialEq<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialEq<I::Item>,
Determines if the elements of this ParallelIterator
are unequal to those of another Read more
fn lt<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
Determines if the elements of this ParallelIterator
are lexicographically less than those of another. Read more
fn le<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
Determines if the elements of this ParallelIterator
are less or equal to those of another. Read more
fn gt<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
Determines if the elements of this ParallelIterator
are lexicographically greater than those of another. Read more
fn ge<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
Determines if the elements of this ParallelIterator
are less or equal to those of another. Read more
fn enumerate(self) -> Enumerate<Self>
[src]
Yields an index along with each item.
fn skip(self, n: usize) -> Skip<Self>
[src]
Creates an iterator that skips the first n
elements.
fn take(self, n: usize) -> Take<Self>
[src]
Creates an iterator that yields the first n
elements.
fn position_any<P>(self, predicate: P) -> Option<usize> where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Searches for some item in the parallel iterator that matches the given predicate, and returns its index. Like ParallelIterator::find_any
, the parallel search will not necessarily find the first match, and once a match is found we'll attempt to stop processing any more. Read more
fn position_first<P>(self, predicate: P) -> Option<usize> where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Searches for the first item in the parallel iterator that matches the given predicate, and returns its index. Read more
fn position_last<P>(self, predicate: P) -> Option<usize> where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Searches for the last item in the parallel iterator that matches the given predicate, and returns its index. Read more
fn rev(self) -> Rev<Self>
[src]
Produces a new iterator with the elements of this iterator in reverse order. Read more
fn with_min_len(self, min: usize) -> MinLen<Self>
[src]
Sets the minimum length of iterators desired to process in each thread. Rayon will not split any smaller than this length, but of course an iterator could already be smaller to begin with. Read more
fn with_max_len(self, max: usize) -> MaxLen<Self>
[src]
Sets the maximum length of iterators desired to process in each thread. Rayon will try to split at least below this length, unless that would put it below the length from with_min_len()
. For example, given min=10 and max=15, a length of 16 will not be split any further. Read more
impl ParallelIterator for Iter<i32>
[src]
type Item = i32
fn drive_unindexed<C>(self, consumer: C) -> C::Result where
C: UnindexedConsumer<Self::Item>,
[src]
C: UnindexedConsumer<Self::Item>,
Internal method used to define the behavior of this parallel iterator. You should not need to call this directly. Read more
fn opt_len(&mut self) -> Option<usize>
[src]
Internal method used to define the behavior of this parallel iterator. You should not need to call this directly. Read more
fn weight(self, _scale: f64) -> Weight<Self>
[src]
: try with_min_len
or with_max_len
instead
Deprecated. If the adaptive algorithms don't split appropriately, try IndexedParallelIterator::with_min_len()
or with_max_len()
instead. Read more
fn weight_max(self) -> Weight<Self>
[src]
: try with_min_len
or with_max_len
instead
Deprecated. If the adaptive algorithms don't split appropriately, try IndexedParallelIterator::with_min_len()
or with_max_len()
instead. Read more
fn for_each<OP>(self, op: OP) where
OP: Fn(Self::Item) + Sync,
[src]
OP: Fn(Self::Item) + Sync,
Executes OP
on each item produced by the iterator, in parallel.
fn count(self) -> usize
[src]
Counts the number of items in this parallel iterator.
fn map<F, R>(self, map_op: F) -> Map<Self, MapFn<F>> where
F: Fn(Self::Item) -> R + Sync,
R: Send,
[src]
F: Fn(Self::Item) -> R + Sync,
R: Send,
Applies map_op
to each item of this iterator, producing a new iterator with the results. Read more
fn cloned<'a, T>(self) -> Map<Self, MapCloned> where
T: 'a + Clone + Send,
Self: ParallelIterator<Item = &'a T>,
[src]
T: 'a + Clone + Send,
Self: ParallelIterator<Item = &'a T>,
Creates an iterator which clones all of its elements. This may be useful when you have an iterator over &T
, but you need T
. Read more
fn inspect<OP>(self, inspect_op: OP) -> Map<Self, MapInspect<OP>> where
OP: Fn(&Self::Item) + Sync,
[src]
OP: Fn(&Self::Item) + Sync,
Applies inspect_op
to a reference to each item of this iterator, producing a new iterator passing through the original items. This is often useful for debugging to see what's happening in iterator stages. Read more
fn filter<P>(self, filter_op: P) -> Filter<Self, P> where
P: Fn(&Self::Item) -> bool + Sync,
[src]
P: Fn(&Self::Item) -> bool + Sync,
Applies filter_op
to each item of this iterator, producing a new iterator with only the items that gave true
results. Read more
fn filter_map<P, R>(self, filter_op: P) -> FilterMap<Self, P> where
P: Fn(Self::Item) -> Option<R> + Sync,
R: Send,
[src]
P: Fn(Self::Item) -> Option<R> + Sync,
R: Send,
Applies filter_op
to each item of this iterator to get an Option
, producing a new iterator with only the items from Some
results. Read more
fn flat_map<F, PI>(self, map_op: F) -> FlatMap<Self, F> where
F: Fn(Self::Item) -> PI + Sync,
PI: IntoParallelIterator,
[src]
F: Fn(Self::Item) -> PI + Sync,
PI: IntoParallelIterator,
Applies map_op
to each item of this iterator to get nested iterators, producing a new iterator that flattens these back into one. Read more
fn reduce<OP, ID>(self, identity: ID, op: OP) -> Self::Item where
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
ID: Fn() -> Self::Item + Sync,
[src]
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
ID: Fn() -> Self::Item + Sync,
Reduces the items in the iterator into one item using op
. The argument identity
should be a closure that can produce "identity" value which may be inserted into the sequence as needed to create opportunities for parallel execution. So, for example, if you are doing a summation, then identity()
ought to produce something that represents the zero for your type (but consider just calling sum()
in that case). Read more
fn reduce_with<OP>(self, op: OP) -> Option<Self::Item> where
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
[src]
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
Reduces the items in the iterator into one item using op
. If the iterator is empty, None
is returned; otherwise, Some
is returned. Read more
fn reduce_with_identity<OP>(self, identity: Self::Item, op: OP) -> Self::Item where
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
Self::Item: Clone + Sync,
[src]
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
Self::Item: Clone + Sync,
: call reduce
instead
Deprecated. Use reduce()
instead.
fn fold<T, ID, F>(self, identity: ID, fold_op: F) -> Fold<Self, ID, F> where
F: Fn(T, Self::Item) -> T + Sync,
ID: Fn() -> T + Sync,
T: Send,
[src]
F: Fn(T, Self::Item) -> T + Sync,
ID: Fn() -> T + Sync,
T: Send,
Parallel fold is similar to sequential fold except that the sequence of items may be subdivided before it is folded. Consider a list of numbers like 22 3 77 89 46
. If you used sequential fold to add them (fold(0, |a,b| a+b)
, you would wind up first adding 0 + 22, then 22 + 3, then 25 + 77, and so forth. The parallel fold works similarly except that it first breaks up your list into sublists, and hence instead of yielding up a single sum at the end, it yields up multiple sums. The number of results is nondeterministic, as is the point where the breaks occur. Read more
fn sum<S>(self) -> S where
S: Send + Sum<Self::Item> + Sum,
[src]
S: Send + Sum<Self::Item> + Sum,
Sums up the items in the iterator. Read more
fn product<P>(self) -> P where
P: Send + Product<Self::Item> + Product,
[src]
P: Send + Product<Self::Item> + Product,
Multiplies all the items in the iterator. Read more
fn mul(self) -> Self::Item where
Self::Item: Product,
[src]
Self::Item: Product,
: name changed to product()
to match sequential iterators
DEPRECATED
fn min(self) -> Option<Self::Item> where
Self::Item: Ord,
[src]
Self::Item: Ord,
Computes the minimum of all the items in the iterator. If the iterator is empty, None
is returned; otherwise, Some(min)
is returned. Read more
fn min_by_key<K, F>(self, f: F) -> Option<Self::Item> where
K: Ord + Send,
F: Sync + Fn(&Self::Item) -> K,
[src]
K: Ord + Send,
F: Sync + Fn(&Self::Item) -> K,
Computes the item that yields the minimum value for the given function. If the iterator is empty, None
is returned; otherwise, Some(item)
is returned. Read more
fn max(self) -> Option<Self::Item> where
Self::Item: Ord,
[src]
Self::Item: Ord,
Computes the maximum of all the items in the iterator. If the iterator is empty, None
is returned; otherwise, Some(max)
is returned. Read more
fn max_by_key<K, F>(self, f: F) -> Option<Self::Item> where
K: Ord + Send,
F: Sync + Fn(&Self::Item) -> K,
[src]
K: Ord + Send,
F: Sync + Fn(&Self::Item) -> K,
Computes the item that yields the maximum value for the given function. If the iterator is empty, None
is returned; otherwise, Some(item)
is returned. Read more
fn chain<C>(self, chain: C) -> Chain<Self, C::Iter> where
C: IntoParallelIterator<Item = Self::Item>,
[src]
C: IntoParallelIterator<Item = Self::Item>,
Takes two iterators and creates a new iterator over both.
fn find_any<P>(self, predicate: P) -> Option<Self::Item> where
P: Fn(&Self::Item) -> bool + Sync,
[src]
P: Fn(&Self::Item) -> bool + Sync,
Searches for some item in the parallel iterator that matches the given predicate and returns it. This operation is similar to [find
on sequential iterators][find] but the item returned may not be the first one in the parallel sequence which matches, since we search the entire sequence in parallel. Read more
fn find_first<P>(self, predicate: P) -> Option<Self::Item> where
P: Fn(&Self::Item) -> bool + Sync,
[src]
P: Fn(&Self::Item) -> bool + Sync,
Searches for the first item in the parallel iterator that matches the given predicate and returns it. Read more
fn find_last<P>(self, predicate: P) -> Option<Self::Item> where
P: Fn(&Self::Item) -> bool + Sync,
[src]
P: Fn(&Self::Item) -> bool + Sync,
Searches for the last item in the parallel iterator that matches the given predicate and returns it. Read more
fn any<P>(self, predicate: P) -> bool where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Searches for some item in the parallel iterator that matches the given predicate, and if so returns true. Once a match is found, we'll attempt to stop process the rest of the items. Proving that there's no match, returning false, does require visiting every item. Read more
fn all<P>(self, predicate: P) -> bool where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Tests that every item in the parallel iterator matches the given predicate, and if so returns true. If a counter-example is found, we'll attempt to stop processing more items, then return false. Read more
fn collect<C>(self) -> C where
C: FromParallelIterator<Self::Item>,
[src]
C: FromParallelIterator<Self::Item>,
Create a fresh collection containing all the element produced by this parallel iterator. Read more
impl BoundedParallelIterator for Iter<i32>
[src]
fn upper_bound(&mut self) -> usize
[src]
fn drive<C>(self, consumer: C) -> C::Result where
C: Consumer<Self::Item>,
[src]
C: Consumer<Self::Item>,
Internal method used to define the behavior of this parallel iterator. You should not need to call this directly. Read more
impl ExactParallelIterator for Iter<i32>
[src]
fn len(&mut self) -> usize
[src]
Produces an exact count of how many items this iterator will produce, presuming no panic occurs. Read more
fn collect_into(self, target: &mut Vec<Self::Item>)
[src]
Collects the results of the iterator into the specified vector. The vector is always truncated before execution begins. If possible, reusing the vector across calls can lead to better performance since it reuses the same backing buffer. Read more
impl IndexedParallelIterator for Iter<i32>
[src]
fn with_producer<CB>(self, callback: CB) -> CB::Output where
CB: ProducerCallback<Self::Item>,
[src]
CB: ProducerCallback<Self::Item>,
Internal method used to define the behavior of this parallel iterator. You should not need to call this directly. Read more
fn zip<Z>(self, zip_op: Z) -> Zip<Self, Z::Iter> where
Z: IntoParallelIterator,
Z::Iter: IndexedParallelIterator,
[src]
Z: IntoParallelIterator,
Z::Iter: IndexedParallelIterator,
Iterate over tuples (A, B)
, where the items A
are from this iterator and B
are from the iterator given as argument. Like the zip
method on ordinary iterators, if the two iterators are of unequal length, you only get the items they have in common. Read more
fn cmp<I>(self, other: I) -> Ordering where
I: IntoParallelIterator<Item = Self::Item>,
I::Iter: IndexedParallelIterator,
Self::Item: Ord,
[src]
I: IntoParallelIterator<Item = Self::Item>,
I::Iter: IndexedParallelIterator,
Self::Item: Ord,
Lexicographically compares the elements of this ParallelIterator
with those of another. Read more
fn partial_cmp<I>(self, other: I) -> Option<Ordering> where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
Lexicographically compares the elements of this ParallelIterator
with those of another. Read more
fn eq<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialEq<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialEq<I::Item>,
Determines if the elements of this ParallelIterator
are equal to those of another Read more
fn ne<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialEq<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialEq<I::Item>,
Determines if the elements of this ParallelIterator
are unequal to those of another Read more
fn lt<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
Determines if the elements of this ParallelIterator
are lexicographically less than those of another. Read more
fn le<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
Determines if the elements of this ParallelIterator
are less or equal to those of another. Read more
fn gt<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
Determines if the elements of this ParallelIterator
are lexicographically greater than those of another. Read more
fn ge<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
Determines if the elements of this ParallelIterator
are less or equal to those of another. Read more
fn enumerate(self) -> Enumerate<Self>
[src]
Yields an index along with each item.
fn skip(self, n: usize) -> Skip<Self>
[src]
Creates an iterator that skips the first n
elements.
fn take(self, n: usize) -> Take<Self>
[src]
Creates an iterator that yields the first n
elements.
fn position_any<P>(self, predicate: P) -> Option<usize> where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Searches for some item in the parallel iterator that matches the given predicate, and returns its index. Like ParallelIterator::find_any
, the parallel search will not necessarily find the first match, and once a match is found we'll attempt to stop processing any more. Read more
fn position_first<P>(self, predicate: P) -> Option<usize> where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Searches for the first item in the parallel iterator that matches the given predicate, and returns its index. Read more
fn position_last<P>(self, predicate: P) -> Option<usize> where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Searches for the last item in the parallel iterator that matches the given predicate, and returns its index. Read more
fn rev(self) -> Rev<Self>
[src]
Produces a new iterator with the elements of this iterator in reverse order. Read more
fn with_min_len(self, min: usize) -> MinLen<Self>
[src]
Sets the minimum length of iterators desired to process in each thread. Rayon will not split any smaller than this length, but of course an iterator could already be smaller to begin with. Read more
fn with_max_len(self, max: usize) -> MaxLen<Self>
[src]
Sets the maximum length of iterators desired to process in each thread. Rayon will try to split at least below this length, unless that would put it below the length from with_min_len()
. For example, given min=10 and max=15, a length of 16 will not be split any further. Read more
impl ParallelIterator for Iter<isize>
[src]
type Item = isize
fn drive_unindexed<C>(self, consumer: C) -> C::Result where
C: UnindexedConsumer<Self::Item>,
[src]
C: UnindexedConsumer<Self::Item>,
Internal method used to define the behavior of this parallel iterator. You should not need to call this directly. Read more
fn opt_len(&mut self) -> Option<usize>
[src]
Internal method used to define the behavior of this parallel iterator. You should not need to call this directly. Read more
fn weight(self, _scale: f64) -> Weight<Self>
[src]
: try with_min_len
or with_max_len
instead
Deprecated. If the adaptive algorithms don't split appropriately, try IndexedParallelIterator::with_min_len()
or with_max_len()
instead. Read more
fn weight_max(self) -> Weight<Self>
[src]
: try with_min_len
or with_max_len
instead
Deprecated. If the adaptive algorithms don't split appropriately, try IndexedParallelIterator::with_min_len()
or with_max_len()
instead. Read more
fn for_each<OP>(self, op: OP) where
OP: Fn(Self::Item) + Sync,
[src]
OP: Fn(Self::Item) + Sync,
Executes OP
on each item produced by the iterator, in parallel.
fn count(self) -> usize
[src]
Counts the number of items in this parallel iterator.
fn map<F, R>(self, map_op: F) -> Map<Self, MapFn<F>> where
F: Fn(Self::Item) -> R + Sync,
R: Send,
[src]
F: Fn(Self::Item) -> R + Sync,
R: Send,
Applies map_op
to each item of this iterator, producing a new iterator with the results. Read more
fn cloned<'a, T>(self) -> Map<Self, MapCloned> where
T: 'a + Clone + Send,
Self: ParallelIterator<Item = &'a T>,
[src]
T: 'a + Clone + Send,
Self: ParallelIterator<Item = &'a T>,
Creates an iterator which clones all of its elements. This may be useful when you have an iterator over &T
, but you need T
. Read more
fn inspect<OP>(self, inspect_op: OP) -> Map<Self, MapInspect<OP>> where
OP: Fn(&Self::Item) + Sync,
[src]
OP: Fn(&Self::Item) + Sync,
Applies inspect_op
to a reference to each item of this iterator, producing a new iterator passing through the original items. This is often useful for debugging to see what's happening in iterator stages. Read more
fn filter<P>(self, filter_op: P) -> Filter<Self, P> where
P: Fn(&Self::Item) -> bool + Sync,
[src]
P: Fn(&Self::Item) -> bool + Sync,
Applies filter_op
to each item of this iterator, producing a new iterator with only the items that gave true
results. Read more
fn filter_map<P, R>(self, filter_op: P) -> FilterMap<Self, P> where
P: Fn(Self::Item) -> Option<R> + Sync,
R: Send,
[src]
P: Fn(Self::Item) -> Option<R> + Sync,
R: Send,
Applies filter_op
to each item of this iterator to get an Option
, producing a new iterator with only the items from Some
results. Read more
fn flat_map<F, PI>(self, map_op: F) -> FlatMap<Self, F> where
F: Fn(Self::Item) -> PI + Sync,
PI: IntoParallelIterator,
[src]
F: Fn(Self::Item) -> PI + Sync,
PI: IntoParallelIterator,
Applies map_op
to each item of this iterator to get nested iterators, producing a new iterator that flattens these back into one. Read more
fn reduce<OP, ID>(self, identity: ID, op: OP) -> Self::Item where
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
ID: Fn() -> Self::Item + Sync,
[src]
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
ID: Fn() -> Self::Item + Sync,
Reduces the items in the iterator into one item using op
. The argument identity
should be a closure that can produce "identity" value which may be inserted into the sequence as needed to create opportunities for parallel execution. So, for example, if you are doing a summation, then identity()
ought to produce something that represents the zero for your type (but consider just calling sum()
in that case). Read more
fn reduce_with<OP>(self, op: OP) -> Option<Self::Item> where
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
[src]
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
Reduces the items in the iterator into one item using op
. If the iterator is empty, None
is returned; otherwise, Some
is returned. Read more
fn reduce_with_identity<OP>(self, identity: Self::Item, op: OP) -> Self::Item where
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
Self::Item: Clone + Sync,
[src]
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
Self::Item: Clone + Sync,
: call reduce
instead
Deprecated. Use reduce()
instead.
fn fold<T, ID, F>(self, identity: ID, fold_op: F) -> Fold<Self, ID, F> where
F: Fn(T, Self::Item) -> T + Sync,
ID: Fn() -> T + Sync,
T: Send,
[src]
F: Fn(T, Self::Item) -> T + Sync,
ID: Fn() -> T + Sync,
T: Send,
Parallel fold is similar to sequential fold except that the sequence of items may be subdivided before it is folded. Consider a list of numbers like 22 3 77 89 46
. If you used sequential fold to add them (fold(0, |a,b| a+b)
, you would wind up first adding 0 + 22, then 22 + 3, then 25 + 77, and so forth. The parallel fold works similarly except that it first breaks up your list into sublists, and hence instead of yielding up a single sum at the end, it yields up multiple sums. The number of results is nondeterministic, as is the point where the breaks occur. Read more
fn sum<S>(self) -> S where
S: Send + Sum<Self::Item> + Sum,
[src]
S: Send + Sum<Self::Item> + Sum,
Sums up the items in the iterator. Read more
fn product<P>(self) -> P where
P: Send + Product<Self::Item> + Product,
[src]
P: Send + Product<Self::Item> + Product,
Multiplies all the items in the iterator. Read more
fn mul(self) -> Self::Item where
Self::Item: Product,
[src]
Self::Item: Product,
: name changed to product()
to match sequential iterators
DEPRECATED
fn min(self) -> Option<Self::Item> where
Self::Item: Ord,
[src]
Self::Item: Ord,
Computes the minimum of all the items in the iterator. If the iterator is empty, None
is returned; otherwise, Some(min)
is returned. Read more
fn min_by_key<K, F>(self, f: F) -> Option<Self::Item> where
K: Ord + Send,
F: Sync + Fn(&Self::Item) -> K,
[src]
K: Ord + Send,
F: Sync + Fn(&Self::Item) -> K,
Computes the item that yields the minimum value for the given function. If the iterator is empty, None
is returned; otherwise, Some(item)
is returned. Read more
fn max(self) -> Option<Self::Item> where
Self::Item: Ord,
[src]
Self::Item: Ord,
Computes the maximum of all the items in the iterator. If the iterator is empty, None
is returned; otherwise, Some(max)
is returned. Read more
fn max_by_key<K, F>(self, f: F) -> Option<Self::Item> where
K: Ord + Send,
F: Sync + Fn(&Self::Item) -> K,
[src]
K: Ord + Send,
F: Sync + Fn(&Self::Item) -> K,
Computes the item that yields the maximum value for the given function. If the iterator is empty, None
is returned; otherwise, Some(item)
is returned. Read more
fn chain<C>(self, chain: C) -> Chain<Self, C::Iter> where
C: IntoParallelIterator<Item = Self::Item>,
[src]
C: IntoParallelIterator<Item = Self::Item>,
Takes two iterators and creates a new iterator over both.
fn find_any<P>(self, predicate: P) -> Option<Self::Item> where
P: Fn(&Self::Item) -> bool + Sync,
[src]
P: Fn(&Self::Item) -> bool + Sync,
Searches for some item in the parallel iterator that matches the given predicate and returns it. This operation is similar to [find
on sequential iterators][find] but the item returned may not be the first one in the parallel sequence which matches, since we search the entire sequence in parallel. Read more
fn find_first<P>(self, predicate: P) -> Option<Self::Item> where
P: Fn(&Self::Item) -> bool + Sync,
[src]
P: Fn(&Self::Item) -> bool + Sync,
Searches for the first item in the parallel iterator that matches the given predicate and returns it. Read more
fn find_last<P>(self, predicate: P) -> Option<Self::Item> where
P: Fn(&Self::Item) -> bool + Sync,
[src]
P: Fn(&Self::Item) -> bool + Sync,
Searches for the last item in the parallel iterator that matches the given predicate and returns it. Read more
fn any<P>(self, predicate: P) -> bool where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Searches for some item in the parallel iterator that matches the given predicate, and if so returns true. Once a match is found, we'll attempt to stop process the rest of the items. Proving that there's no match, returning false, does require visiting every item. Read more
fn all<P>(self, predicate: P) -> bool where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Tests that every item in the parallel iterator matches the given predicate, and if so returns true. If a counter-example is found, we'll attempt to stop processing more items, then return false. Read more
fn collect<C>(self) -> C where
C: FromParallelIterator<Self::Item>,
[src]
C: FromParallelIterator<Self::Item>,
Create a fresh collection containing all the element produced by this parallel iterator. Read more
impl BoundedParallelIterator for Iter<isize>
[src]
fn upper_bound(&mut self) -> usize
[src]
fn drive<C>(self, consumer: C) -> C::Result where
C: Consumer<Self::Item>,
[src]
C: Consumer<Self::Item>,
Internal method used to define the behavior of this parallel iterator. You should not need to call this directly. Read more
impl ExactParallelIterator for Iter<isize>
[src]
fn len(&mut self) -> usize
[src]
Produces an exact count of how many items this iterator will produce, presuming no panic occurs. Read more
fn collect_into(self, target: &mut Vec<Self::Item>)
[src]
Collects the results of the iterator into the specified vector. The vector is always truncated before execution begins. If possible, reusing the vector across calls can lead to better performance since it reuses the same backing buffer. Read more
impl IndexedParallelIterator for Iter<isize>
[src]
fn with_producer<CB>(self, callback: CB) -> CB::Output where
CB: ProducerCallback<Self::Item>,
[src]
CB: ProducerCallback<Self::Item>,
Internal method used to define the behavior of this parallel iterator. You should not need to call this directly. Read more
fn zip<Z>(self, zip_op: Z) -> Zip<Self, Z::Iter> where
Z: IntoParallelIterator,
Z::Iter: IndexedParallelIterator,
[src]
Z: IntoParallelIterator,
Z::Iter: IndexedParallelIterator,
Iterate over tuples (A, B)
, where the items A
are from this iterator and B
are from the iterator given as argument. Like the zip
method on ordinary iterators, if the two iterators are of unequal length, you only get the items they have in common. Read more
fn cmp<I>(self, other: I) -> Ordering where
I: IntoParallelIterator<Item = Self::Item>,
I::Iter: IndexedParallelIterator,
Self::Item: Ord,
[src]
I: IntoParallelIterator<Item = Self::Item>,
I::Iter: IndexedParallelIterator,
Self::Item: Ord,
Lexicographically compares the elements of this ParallelIterator
with those of another. Read more
fn partial_cmp<I>(self, other: I) -> Option<Ordering> where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
Lexicographically compares the elements of this ParallelIterator
with those of another. Read more
fn eq<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialEq<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialEq<I::Item>,
Determines if the elements of this ParallelIterator
are equal to those of another Read more
fn ne<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialEq<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialEq<I::Item>,
Determines if the elements of this ParallelIterator
are unequal to those of another Read more
fn lt<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
Determines if the elements of this ParallelIterator
are lexicographically less than those of another. Read more
fn le<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
Determines if the elements of this ParallelIterator
are less or equal to those of another. Read more
fn gt<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
Determines if the elements of this ParallelIterator
are lexicographically greater than those of another. Read more
fn ge<I>(self, other: I) -> bool where
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
[src]
I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>,
Determines if the elements of this ParallelIterator
are less or equal to those of another. Read more
fn enumerate(self) -> Enumerate<Self>
[src]
Yields an index along with each item.
fn skip(self, n: usize) -> Skip<Self>
[src]
Creates an iterator that skips the first n
elements.
fn take(self, n: usize) -> Take<Self>
[src]
Creates an iterator that yields the first n
elements.
fn position_any<P>(self, predicate: P) -> Option<usize> where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Searches for some item in the parallel iterator that matches the given predicate, and returns its index. Like ParallelIterator::find_any
, the parallel search will not necessarily find the first match, and once a match is found we'll attempt to stop processing any more. Read more
fn position_first<P>(self, predicate: P) -> Option<usize> where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Searches for the first item in the parallel iterator that matches the given predicate, and returns its index. Read more
fn position_last<P>(self, predicate: P) -> Option<usize> where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Searches for the last item in the parallel iterator that matches the given predicate, and returns its index. Read more
fn rev(self) -> Rev<Self>
[src]
Produces a new iterator with the elements of this iterator in reverse order. Read more
fn with_min_len(self, min: usize) -> MinLen<Self>
[src]
Sets the minimum length of iterators desired to process in each thread. Rayon will not split any smaller than this length, but of course an iterator could already be smaller to begin with. Read more
fn with_max_len(self, max: usize) -> MaxLen<Self>
[src]
Sets the maximum length of iterators desired to process in each thread. Rayon will try to split at least below this length, unless that would put it below the length from with_min_len()
. For example, given min=10 and max=15, a length of 16 will not be split any further. Read more
impl ParallelIterator for Iter<u64>
[src]
type Item = u64
fn drive_unindexed<C>(self, consumer: C) -> C::Result where
C: UnindexedConsumer<Self::Item>,
[src]
C: UnindexedConsumer<Self::Item>,
Internal method used to define the behavior of this parallel iterator. You should not need to call this directly. Read more
fn weight(self, _scale: f64) -> Weight<Self>
[src]
: try with_min_len
or with_max_len
instead
Deprecated. If the adaptive algorithms don't split appropriately, try IndexedParallelIterator::with_min_len()
or with_max_len()
instead. Read more
fn weight_max(self) -> Weight<Self>
[src]
: try with_min_len
or with_max_len
instead
Deprecated. If the adaptive algorithms don't split appropriately, try IndexedParallelIterator::with_min_len()
or with_max_len()
instead. Read more
fn for_each<OP>(self, op: OP) where
OP: Fn(Self::Item) + Sync,
[src]
OP: Fn(Self::Item) + Sync,
Executes OP
on each item produced by the iterator, in parallel.
fn count(self) -> usize
[src]
Counts the number of items in this parallel iterator.
fn map<F, R>(self, map_op: F) -> Map<Self, MapFn<F>> where
F: Fn(Self::Item) -> R + Sync,
R: Send,
[src]
F: Fn(Self::Item) -> R + Sync,
R: Send,
Applies map_op
to each item of this iterator, producing a new iterator with the results. Read more
fn cloned<'a, T>(self) -> Map<Self, MapCloned> where
T: 'a + Clone + Send,
Self: ParallelIterator<Item = &'a T>,
[src]
T: 'a + Clone + Send,
Self: ParallelIterator<Item = &'a T>,
Creates an iterator which clones all of its elements. This may be useful when you have an iterator over &T
, but you need T
. Read more
fn inspect<OP>(self, inspect_op: OP) -> Map<Self, MapInspect<OP>> where
OP: Fn(&Self::Item) + Sync,
[src]
OP: Fn(&Self::Item) + Sync,
Applies inspect_op
to a reference to each item of this iterator, producing a new iterator passing through the original items. This is often useful for debugging to see what's happening in iterator stages. Read more
fn filter<P>(self, filter_op: P) -> Filter<Self, P> where
P: Fn(&Self::Item) -> bool + Sync,
[src]
P: Fn(&Self::Item) -> bool + Sync,
Applies filter_op
to each item of this iterator, producing a new iterator with only the items that gave true
results. Read more
fn filter_map<P, R>(self, filter_op: P) -> FilterMap<Self, P> where
P: Fn(Self::Item) -> Option<R> + Sync,
R: Send,
[src]
P: Fn(Self::Item) -> Option<R> + Sync,
R: Send,
Applies filter_op
to each item of this iterator to get an Option
, producing a new iterator with only the items from Some
results. Read more
fn flat_map<F, PI>(self, map_op: F) -> FlatMap<Self, F> where
F: Fn(Self::Item) -> PI + Sync,
PI: IntoParallelIterator,
[src]
F: Fn(Self::Item) -> PI + Sync,
PI: IntoParallelIterator,
Applies map_op
to each item of this iterator to get nested iterators, producing a new iterator that flattens these back into one. Read more
fn reduce<OP, ID>(self, identity: ID, op: OP) -> Self::Item where
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
ID: Fn() -> Self::Item + Sync,
[src]
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
ID: Fn() -> Self::Item + Sync,
Reduces the items in the iterator into one item using op
. The argument identity
should be a closure that can produce "identity" value which may be inserted into the sequence as needed to create opportunities for parallel execution. So, for example, if you are doing a summation, then identity()
ought to produce something that represents the zero for your type (but consider just calling sum()
in that case). Read more
fn reduce_with<OP>(self, op: OP) -> Option<Self::Item> where
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
[src]
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
Reduces the items in the iterator into one item using op
. If the iterator is empty, None
is returned; otherwise, Some
is returned. Read more
fn reduce_with_identity<OP>(self, identity: Self::Item, op: OP) -> Self::Item where
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
Self::Item: Clone + Sync,
[src]
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
Self::Item: Clone + Sync,
: call reduce
instead
Deprecated. Use reduce()
instead.
fn fold<T, ID, F>(self, identity: ID, fold_op: F) -> Fold<Self, ID, F> where
F: Fn(T, Self::Item) -> T + Sync,
ID: Fn() -> T + Sync,
T: Send,
[src]
F: Fn(T, Self::Item) -> T + Sync,
ID: Fn() -> T + Sync,
T: Send,
Parallel fold is similar to sequential fold except that the sequence of items may be subdivided before it is folded. Consider a list of numbers like 22 3 77 89 46
. If you used sequential fold to add them (fold(0, |a,b| a+b)
, you would wind up first adding 0 + 22, then 22 + 3, then 25 + 77, and so forth. The parallel fold works similarly except that it first breaks up your list into sublists, and hence instead of yielding up a single sum at the end, it yields up multiple sums. The number of results is nondeterministic, as is the point where the breaks occur. Read more
fn sum<S>(self) -> S where
S: Send + Sum<Self::Item> + Sum,
[src]
S: Send + Sum<Self::Item> + Sum,
Sums up the items in the iterator. Read more
fn product<P>(self) -> P where
P: Send + Product<Self::Item> + Product,
[src]
P: Send + Product<Self::Item> + Product,
Multiplies all the items in the iterator. Read more
fn mul(self) -> Self::Item where
Self::Item: Product,
[src]
Self::Item: Product,
: name changed to product()
to match sequential iterators
DEPRECATED
fn min(self) -> Option<Self::Item> where
Self::Item: Ord,
[src]
Self::Item: Ord,
Computes the minimum of all the items in the iterator. If the iterator is empty, None
is returned; otherwise, Some(min)
is returned. Read more
fn min_by_key<K, F>(self, f: F) -> Option<Self::Item> where
K: Ord + Send,
F: Sync + Fn(&Self::Item) -> K,
[src]
K: Ord + Send,
F: Sync + Fn(&Self::Item) -> K,
Computes the item that yields the minimum value for the given function. If the iterator is empty, None
is returned; otherwise, Some(item)
is returned. Read more
fn max(self) -> Option<Self::Item> where
Self::Item: Ord,
[src]
Self::Item: Ord,
Computes the maximum of all the items in the iterator. If the iterator is empty, None
is returned; otherwise, Some(max)
is returned. Read more
fn max_by_key<K, F>(self, f: F) -> Option<Self::Item> where
K: Ord + Send,
F: Sync + Fn(&Self::Item) -> K,
[src]
K: Ord + Send,
F: Sync + Fn(&Self::Item) -> K,
Computes the item that yields the maximum value for the given function. If the iterator is empty, None
is returned; otherwise, Some(item)
is returned. Read more
fn chain<C>(self, chain: C) -> Chain<Self, C::Iter> where
C: IntoParallelIterator<Item = Self::Item>,
[src]
C: IntoParallelIterator<Item = Self::Item>,
Takes two iterators and creates a new iterator over both.
fn find_any<P>(self, predicate: P) -> Option<Self::Item> where
P: Fn(&Self::Item) -> bool + Sync,
[src]
P: Fn(&Self::Item) -> bool + Sync,
Searches for some item in the parallel iterator that matches the given predicate and returns it. This operation is similar to [find
on sequential iterators][find] but the item returned may not be the first one in the parallel sequence which matches, since we search the entire sequence in parallel. Read more
fn find_first<P>(self, predicate: P) -> Option<Self::Item> where
P: Fn(&Self::Item) -> bool + Sync,
[src]
P: Fn(&Self::Item) -> bool + Sync,
Searches for the first item in the parallel iterator that matches the given predicate and returns it. Read more
fn find_last<P>(self, predicate: P) -> Option<Self::Item> where
P: Fn(&Self::Item) -> bool + Sync,
[src]
P: Fn(&Self::Item) -> bool + Sync,
Searches for the last item in the parallel iterator that matches the given predicate and returns it. Read more
fn any<P>(self, predicate: P) -> bool where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Searches for some item in the parallel iterator that matches the given predicate, and if so returns true. Once a match is found, we'll attempt to stop process the rest of the items. Proving that there's no match, returning false, does require visiting every item. Read more
fn all<P>(self, predicate: P) -> bool where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Tests that every item in the parallel iterator matches the given predicate, and if so returns true. If a counter-example is found, we'll attempt to stop processing more items, then return false. Read more
fn collect<C>(self) -> C where
C: FromParallelIterator<Self::Item>,
[src]
C: FromParallelIterator<Self::Item>,
Create a fresh collection containing all the element produced by this parallel iterator. Read more
fn opt_len(&mut self) -> Option<usize>
[src]
Internal method used to define the behavior of this parallel iterator. You should not need to call this directly. Read more
impl ParallelIterator for Iter<i64>
[src]
type Item = i64
fn drive_unindexed<C>(self, consumer: C) -> C::Result where
C: UnindexedConsumer<Self::Item>,
[src]
C: UnindexedConsumer<Self::Item>,
Internal method used to define the behavior of this parallel iterator. You should not need to call this directly. Read more
fn weight(self, _scale: f64) -> Weight<Self>
[src]
: try with_min_len
or with_max_len
instead
Deprecated. If the adaptive algorithms don't split appropriately, try IndexedParallelIterator::with_min_len()
or with_max_len()
instead. Read more
fn weight_max(self) -> Weight<Self>
[src]
: try with_min_len
or with_max_len
instead
Deprecated. If the adaptive algorithms don't split appropriately, try IndexedParallelIterator::with_min_len()
or with_max_len()
instead. Read more
fn for_each<OP>(self, op: OP) where
OP: Fn(Self::Item) + Sync,
[src]
OP: Fn(Self::Item) + Sync,
Executes OP
on each item produced by the iterator, in parallel.
fn count(self) -> usize
[src]
Counts the number of items in this parallel iterator.
fn map<F, R>(self, map_op: F) -> Map<Self, MapFn<F>> where
F: Fn(Self::Item) -> R + Sync,
R: Send,
[src]
F: Fn(Self::Item) -> R + Sync,
R: Send,
Applies map_op
to each item of this iterator, producing a new iterator with the results. Read more
fn cloned<'a, T>(self) -> Map<Self, MapCloned> where
T: 'a + Clone + Send,
Self: ParallelIterator<Item = &'a T>,
[src]
T: 'a + Clone + Send,
Self: ParallelIterator<Item = &'a T>,
Creates an iterator which clones all of its elements. This may be useful when you have an iterator over &T
, but you need T
. Read more
fn inspect<OP>(self, inspect_op: OP) -> Map<Self, MapInspect<OP>> where
OP: Fn(&Self::Item) + Sync,
[src]
OP: Fn(&Self::Item) + Sync,
Applies inspect_op
to a reference to each item of this iterator, producing a new iterator passing through the original items. This is often useful for debugging to see what's happening in iterator stages. Read more
fn filter<P>(self, filter_op: P) -> Filter<Self, P> where
P: Fn(&Self::Item) -> bool + Sync,
[src]
P: Fn(&Self::Item) -> bool + Sync,
Applies filter_op
to each item of this iterator, producing a new iterator with only the items that gave true
results. Read more
fn filter_map<P, R>(self, filter_op: P) -> FilterMap<Self, P> where
P: Fn(Self::Item) -> Option<R> + Sync,
R: Send,
[src]
P: Fn(Self::Item) -> Option<R> + Sync,
R: Send,
Applies filter_op
to each item of this iterator to get an Option
, producing a new iterator with only the items from Some
results. Read more
fn flat_map<F, PI>(self, map_op: F) -> FlatMap<Self, F> where
F: Fn(Self::Item) -> PI + Sync,
PI: IntoParallelIterator,
[src]
F: Fn(Self::Item) -> PI + Sync,
PI: IntoParallelIterator,
Applies map_op
to each item of this iterator to get nested iterators, producing a new iterator that flattens these back into one. Read more
fn reduce<OP, ID>(self, identity: ID, op: OP) -> Self::Item where
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
ID: Fn() -> Self::Item + Sync,
[src]
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
ID: Fn() -> Self::Item + Sync,
Reduces the items in the iterator into one item using op
. The argument identity
should be a closure that can produce "identity" value which may be inserted into the sequence as needed to create opportunities for parallel execution. So, for example, if you are doing a summation, then identity()
ought to produce something that represents the zero for your type (but consider just calling sum()
in that case). Read more
fn reduce_with<OP>(self, op: OP) -> Option<Self::Item> where
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
[src]
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
Reduces the items in the iterator into one item using op
. If the iterator is empty, None
is returned; otherwise, Some
is returned. Read more
fn reduce_with_identity<OP>(self, identity: Self::Item, op: OP) -> Self::Item where
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
Self::Item: Clone + Sync,
[src]
OP: Fn(Self::Item, Self::Item) -> Self::Item + Sync,
Self::Item: Clone + Sync,
: call reduce
instead
Deprecated. Use reduce()
instead.
fn fold<T, ID, F>(self, identity: ID, fold_op: F) -> Fold<Self, ID, F> where
F: Fn(T, Self::Item) -> T + Sync,
ID: Fn() -> T + Sync,
T: Send,
[src]
F: Fn(T, Self::Item) -> T + Sync,
ID: Fn() -> T + Sync,
T: Send,
Parallel fold is similar to sequential fold except that the sequence of items may be subdivided before it is folded. Consider a list of numbers like 22 3 77 89 46
. If you used sequential fold to add them (fold(0, |a,b| a+b)
, you would wind up first adding 0 + 22, then 22 + 3, then 25 + 77, and so forth. The parallel fold works similarly except that it first breaks up your list into sublists, and hence instead of yielding up a single sum at the end, it yields up multiple sums. The number of results is nondeterministic, as is the point where the breaks occur. Read more
fn sum<S>(self) -> S where
S: Send + Sum<Self::Item> + Sum,
[src]
S: Send + Sum<Self::Item> + Sum,
Sums up the items in the iterator. Read more
fn product<P>(self) -> P where
P: Send + Product<Self::Item> + Product,
[src]
P: Send + Product<Self::Item> + Product,
Multiplies all the items in the iterator. Read more
fn mul(self) -> Self::Item where
Self::Item: Product,
[src]
Self::Item: Product,
: name changed to product()
to match sequential iterators
DEPRECATED
fn min(self) -> Option<Self::Item> where
Self::Item: Ord,
[src]
Self::Item: Ord,
Computes the minimum of all the items in the iterator. If the iterator is empty, None
is returned; otherwise, Some(min)
is returned. Read more
fn min_by_key<K, F>(self, f: F) -> Option<Self::Item> where
K: Ord + Send,
F: Sync + Fn(&Self::Item) -> K,
[src]
K: Ord + Send,
F: Sync + Fn(&Self::Item) -> K,
Computes the item that yields the minimum value for the given function. If the iterator is empty, None
is returned; otherwise, Some(item)
is returned. Read more
fn max(self) -> Option<Self::Item> where
Self::Item: Ord,
[src]
Self::Item: Ord,
Computes the maximum of all the items in the iterator. If the iterator is empty, None
is returned; otherwise, Some(max)
is returned. Read more
fn max_by_key<K, F>(self, f: F) -> Option<Self::Item> where
K: Ord + Send,
F: Sync + Fn(&Self::Item) -> K,
[src]
K: Ord + Send,
F: Sync + Fn(&Self::Item) -> K,
Computes the item that yields the maximum value for the given function. If the iterator is empty, None
is returned; otherwise, Some(item)
is returned. Read more
fn chain<C>(self, chain: C) -> Chain<Self, C::Iter> where
C: IntoParallelIterator<Item = Self::Item>,
[src]
C: IntoParallelIterator<Item = Self::Item>,
Takes two iterators and creates a new iterator over both.
fn find_any<P>(self, predicate: P) -> Option<Self::Item> where
P: Fn(&Self::Item) -> bool + Sync,
[src]
P: Fn(&Self::Item) -> bool + Sync,
Searches for some item in the parallel iterator that matches the given predicate and returns it. This operation is similar to [find
on sequential iterators][find] but the item returned may not be the first one in the parallel sequence which matches, since we search the entire sequence in parallel. Read more
fn find_first<P>(self, predicate: P) -> Option<Self::Item> where
P: Fn(&Self::Item) -> bool + Sync,
[src]
P: Fn(&Self::Item) -> bool + Sync,
Searches for the first item in the parallel iterator that matches the given predicate and returns it. Read more
fn find_last<P>(self, predicate: P) -> Option<Self::Item> where
P: Fn(&Self::Item) -> bool + Sync,
[src]
P: Fn(&Self::Item) -> bool + Sync,
Searches for the last item in the parallel iterator that matches the given predicate and returns it. Read more
fn any<P>(self, predicate: P) -> bool where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Searches for some item in the parallel iterator that matches the given predicate, and if so returns true. Once a match is found, we'll attempt to stop process the rest of the items. Proving that there's no match, returning false, does require visiting every item. Read more
fn all<P>(self, predicate: P) -> bool where
P: Fn(Self::Item) -> bool + Sync,
[src]
P: Fn(Self::Item) -> bool + Sync,
Tests that every item in the parallel iterator matches the given predicate, and if so returns true. If a counter-example is found, we'll attempt to stop processing more items, then return false. Read more
fn collect<C>(self) -> C where
C: FromParallelIterator<Self::Item>,
[src]
C: FromParallelIterator<Self::Item>,
Create a fresh collection containing all the element produced by this parallel iterator. Read more
fn opt_len(&mut self) -> Option<usize>
[src]
Internal method used to define the behavior of this parallel iterator. You should not need to call this directly. Read more