Trait rayon::iter::IndexedParallelIterator
[−]
[src]
pub trait IndexedParallelIterator: ExactParallelIterator { fn with_producer<CB: ProducerCallback<Self::Item>>(self,
callback: CB)
-> CB::Output; fn zip<Z>(self, zip_op: Z) -> Zip<Self, Z::Iter> where Z: IntoParallelIterator, Z::Iter: IndexedParallelIterator { ... } fn cmp<I>(self, other: I) -> Ordering where I: IntoParallelIterator<Item=Self::Item>,
I::Iter: IndexedParallelIterator,
Self::Item: Ord { ... } fn partial_cmp<I>(self, other: I) -> Option<Ordering> where I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item> { ... } fn eq<I>(self, other: I) -> bool where I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialEq<I::Item> { ... } fn ne<I>(self, other: I) -> bool where I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialEq<I::Item> { ... } fn lt<I>(self, other: I) -> bool where I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item> { ... } fn le<I>(self, other: I) -> bool where I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item> { ... } fn gt<I>(self, other: I) -> bool where I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item> { ... } fn ge<I>(self, other: I) -> bool where I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item> { ... } fn enumerate(self) -> Enumerate<Self> { ... } fn skip(self, n: usize) -> Skip<Self> { ... } fn take(self, n: usize) -> Take<Self> { ... } fn position_any<P>(self, predicate: P) -> Option<usize> where P: Fn(Self::Item) -> bool + Sync { ... } fn position_first<P>(self, predicate: P) -> Option<usize> where P: Fn(Self::Item) -> bool + Sync { ... } fn position_last<P>(self, predicate: P) -> Option<usize> where P: Fn(Self::Item) -> bool + Sync { ... } fn rev(self) -> Rev<Self> { ... } fn with_min_len(self, min: usize) -> MinLen<Self> { ... } fn with_max_len(self, max: usize) -> MaxLen<Self> { ... } }
An iterator that supports "random access" to its data, meaning that you can split it at arbitrary indices and draw data from those points.
Required Methods
fn with_producer<CB: ProducerCallback<Self::Item>>(self,
callback: CB)
-> CB::Output
callback: CB)
-> CB::Output
Internal method used to define the behavior of this parallel iterator. You should not need to call this directly.
This method converts the iterator into a producer P and then
invokes callback.callback()
with P. Note that the type of
this producer is not defined as part of the API, since
callback
must be defined generically for all producers. This
allows the producer type to contain references; it also means
that parallel iterators can adjust that type without causing a
breaking change.
See the README for more details on the internals of parallel iterators.
Provided Methods
fn zip<Z>(self, zip_op: Z) -> Zip<Self, Z::Iter> where 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.
fn cmp<I>(self, other: I) -> Ordering where I: IntoParallelIterator<Item=Self::Item>,
I::Iter: IndexedParallelIterator,
Self::Item: Ord
I::Iter: IndexedParallelIterator,
Self::Item: Ord
Lexicographically compares the elements of this ParallelIterator
with those of
another.
fn partial_cmp<I>(self, other: I) -> Option<Ordering> where I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>
Lexicographically compares the elements of this ParallelIterator
with those of
another.
fn eq<I>(self, other: I) -> bool where I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialEq<I::Item>
I::Iter: IndexedParallelIterator,
Self::Item: PartialEq<I::Item>
Determines if the elements of this ParallelIterator
are equal to those of another
fn ne<I>(self, other: I) -> bool where I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialEq<I::Item>
I::Iter: IndexedParallelIterator,
Self::Item: PartialEq<I::Item>
Determines if the elements of this ParallelIterator
are unequal to those of another
fn lt<I>(self, other: I) -> bool where I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>
Determines if the elements of this ParallelIterator
are lexicographically less than those of another.
fn le<I>(self, other: I) -> bool where I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>
Determines if the elements of this ParallelIterator
are less or equal to those of another.
fn gt<I>(self, other: I) -> bool where I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>
Determines if the elements of this ParallelIterator
are lexicographically greater than those of another.
fn ge<I>(self, other: I) -> bool where I: IntoParallelIterator,
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>
I::Iter: IndexedParallelIterator,
Self::Item: PartialOrd<I::Item>
Determines if the elements of this ParallelIterator
are less or equal to those of another.
fn enumerate(self) -> Enumerate<Self>
Yields an index along with each item.
fn skip(self, n: usize) -> Skip<Self>
Creates an iterator that skips the first n
elements.
fn take(self, n: usize) -> Take<Self>
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
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.
fn position_first<P>(self, predicate: P) -> Option<usize> where P: Fn(Self::Item) -> bool + Sync
Searches for the first item in the parallel iterator that matches the given predicate, and returns its index.
Like ParallelIterator::find_first
, once a match is found,
all attempts to the right of the match will be stopped, while
attempts to the left must continue in case an earlier match
is found.
Note that not all parallel iterators have a useful order, much like
sequential HashMap
iteration, so "first" may be nebulous.
fn position_last<P>(self, predicate: P) -> Option<usize> where P: Fn(Self::Item) -> bool + Sync
Searches for the last item in the parallel iterator that matches the given predicate, and returns its index.
Like ParallelIterator::find_last
, once a match is found,
all attempts to the left of the match will be stopped, while
attempts to the right must continue in case a later match
is found.
Note that not all parallel iterators have a useful order, much like
sequential HashMap
iteration, so "last" may be nebulous.
fn rev(self) -> Rev<Self>
Produces a new iterator with the elements of this iterator in reverse order.
fn with_min_len(self, min: usize) -> MinLen<Self>
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.
fn with_max_len(self, max: usize) -> MaxLen<Self>
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.
Implementors
impl<T: Ord + Send> IndexedParallelIterator for rayon::collections::binary_heap::IntoIter<T>
impl<'a, T: Ord + Sync + 'a> IndexedParallelIterator for rayon::collections::binary_heap::Iter<'a, T>
impl<T: Send> IndexedParallelIterator for rayon::collections::vec_deque::IntoIter<T>
impl<'a, T: Sync + 'a> IndexedParallelIterator for rayon::collections::vec_deque::Iter<'a, T>
impl<'a, T: Send + 'a> IndexedParallelIterator for rayon::collections::vec_deque::IterMut<'a, T>
impl<A, B> IndexedParallelIterator for Chain<A, B> where A: IndexedParallelIterator,
B: IndexedParallelIterator<Item=A::Item>impl<I> IndexedParallelIterator for Enumerate<I> where I: IndexedParallelIterator
impl<I> IndexedParallelIterator for Skip<I> where I: IndexedParallelIterator
impl<I> IndexedParallelIterator for Take<I> where I: IndexedParallelIterator
impl<I, F> IndexedParallelIterator for Map<I, F> where I: IndexedParallelIterator,
F: MapOp<I::Item>impl<I: IndexedParallelIterator> IndexedParallelIterator for Weight<I>
impl<A, B> IndexedParallelIterator for Zip<A, B> where A: IndexedParallelIterator,
B: IndexedParallelIteratorimpl<I> IndexedParallelIterator for Rev<I> where I: IndexedParallelIterator
impl<I> IndexedParallelIterator for MinLen<I> where I: IndexedParallelIterator
impl<I> IndexedParallelIterator for MaxLen<I> where I: IndexedParallelIterator
impl<T: Send> IndexedParallelIterator for rayon::option::IntoIter<T>
impl<'a, T: Sync + 'a> IndexedParallelIterator for rayon::option::Iter<'a, T>
impl<'a, T: Send + 'a> IndexedParallelIterator for rayon::option::IterMut<'a, T>
impl IndexedParallelIterator for rayon::range::Iter<u8>
impl IndexedParallelIterator for rayon::range::Iter<u16>
impl IndexedParallelIterator for rayon::range::Iter<u32>
impl IndexedParallelIterator for rayon::range::Iter<usize>
impl IndexedParallelIterator for rayon::range::Iter<i8>
impl IndexedParallelIterator for rayon::range::Iter<i16>
impl IndexedParallelIterator for rayon::range::Iter<i32>
impl IndexedParallelIterator for rayon::range::Iter<isize>
impl<T: Send> IndexedParallelIterator for rayon::result::IntoIter<T>
impl<'a, T: Sync + 'a> IndexedParallelIterator for rayon::result::Iter<'a, T>
impl<'a, T: Send + 'a> IndexedParallelIterator for rayon::result::IterMut<'a, T>
impl<'data, T: Sync + 'data> IndexedParallelIterator for rayon::slice::Iter<'data, T>
impl<'data, T: Sync + 'data> IndexedParallelIterator for Chunks<'data, T>
impl<'data, T: Sync + 'data> IndexedParallelIterator for Windows<'data, T>
impl<'data, T: Send + 'data> IndexedParallelIterator for rayon::slice::IterMut<'data, T>
impl<'data, T: Send + 'data> IndexedParallelIterator for ChunksMut<'data, T>
impl<T: Send> IndexedParallelIterator for rayon::vec::IntoIter<T>