Module rayon::iter [] [src]

The ParallelIterator module makes it easy to write parallel programs using an iterator-style interface. To get access to all the methods you want, the easiest is to write use rayon::prelude::*; at the top of your module, which will import the various traits and methods you need.

The submodules of this module mostly just contain implementaton details of little interest to an end-user. If you'd like to read the code itself, the plumbing module and README.md file are a good place to start.

Modules

plumbing

Traits and functions used to implement parallel iteration. These are low-level details -- users of parallel iterators should not need to interact with them directly. See README.md for a high-level overview.

Structs

Chain

Chain is an iterator that joins b after a in one continuous iterator. This struct is created by the chain() method on ParallelIterator

Cloned

Cloned is an iterator that clones the elements of an underlying iterator.

Empty

Iterator adaptor for the empty() function.

Enumerate

Enumerate is an iterator that returns the current count along with the element. This struct is created by the enumerate() method on ParallelIterator

Filter

Filter takes a predicate filter_op and filters out elements that match. This struct is created by the filter() method on ParallelIterator

FilterMap

FilterMap creates an iterator that uses filter_op to both filter and map elements. This struct is created by the filter_map() method on ParallelIterator.

FlatMap

FlatMap maps each element to an iterator, then flattens these iterators together. This struct is created by the flat_map() method on ParallelIterator

Flatten

Flatten turns each element to an iterator, then flattens these iterators together. This struct is created by the flatten() method on ParallelIterator.

Fold

Fold is an iterator that applies a function over an iterator producing a single value. This struct is created by the fold() method on ParallelIterator

FoldWith

FoldWith is an iterator that applies a function over an iterator producing a single value. This struct is created by the fold_with() method on ParallelIterator

Inspect

Inspect is an iterator that calls a function with a reference to each element before yielding it.

Interleave

Interleave is an iterator that interleaves elements of iterators i and j in one continuous iterator. This struct is created by the interleave() method on IndexedParallelIterator

InterleaveShortest

InterleaveShortest is an iterator that works similarly to Interleave, but this version stops returning elements once one of the iterators run out.

Intersperse

Intersperse is an iterator that inserts a particular item between each item of the adapted iterator. This struct is created by the intersperse() method on ParallelIterator

Map

Map is an iterator that transforms the elements of an underlying iterator.

MapWith

MapWith is an iterator that transforms the elements of an underlying iterator.

MaxLen

MaxLen is an iterator that imposes a maximum length on iterator splits. This struct is created by the max_len() method on IndexedParallelIterator

MinLen

MinLen is an iterator that imposes a minimum length on iterator splits. This struct is created by the min_len() method on IndexedParallelIterator

Once

Iterator adaptor for the once() function.

Repeat

Iterator adaptor for the repeat() function.

RepeatN

Iterator adaptor for the repeatn() function.

Rev

Rev is an iterator that produces elements in reverse order. This struct is created by the rev() method on IndexedParallelIterator

Skip

Skip is an iterator that skips over the first n elements. This struct is created by the skip() method on ParallelIterator

Split

Split is a parallel iterator using arbitrary data and a splitting function. This struct is created by the split() function.

Take

Take is an iterator that iterates over the first n elements. This struct is created by the take() method on ParallelIterator

WhileSome

WhileSome is an iterator that yields the Some elements of an iterator, halting as soon as any None is produced.

Zip

Zip is an iterator that zips up a and b into a single iterator of pairs. This struct is created by the zip() method on IndexedParallelIterator

ZipEq

An IndexedParallelIterator that iterates over two parallel iterators of equal length simultaneously.

Enums

Either

The enum Either with variants Left and Right is a general purpose sum type with two cases.

Traits

FromParallelIterator

FromParallelIterator implements the conversion from a ParallelIterator. By implementing FromParallelIterator for a type, you define how it will be created from an iterator.

IndexedParallelIterator

An iterator that supports "random access" to its data, meaning that you can split it at arbitrary indices and draw data from those points.

IntoParallelIterator

IntoParallelIterator implements the conversion to a ParallelIterator.

IntoParallelRefIterator

IntoParallelRefIterator implements the conversion to a ParallelIterator, providing shared references to the data.

IntoParallelRefMutIterator

IntoParallelRefMutIterator implements the conversion to a ParallelIterator, providing mutable references to the data.

ParallelExtend

ParallelExtend extends an existing collection with items from a ParallelIterator.

ParallelIterator

The ParallelIterator interface.

Functions

empty

Creates a parallel iterator that produces nothing.

once

Creates a parallel iterator that produces an element exactly once.

repeat

Creates a parallel iterator that endlessly repeats elt (by cloning it). Note that this iterator has "infinite" length, so typically you would want to use zip or take or some other means to shorten it, or consider using the repeatn() function instead.

repeatn

Creates a parallel iterator that produces n repeats of elt (by cloning it).

split

The split function takes arbitrary data and a closure that knows how to split it, and turns this into a ParallelIterator.