2018-10-28 21:14:05 -05:00

489 lines
35 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `iter` mod in crate `rayon`."><meta name="keywords" content="rust, rustlang, rust-lang, iter"><title>rayon::iter - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><p class='location'>Module iter</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#modules">Modules</a></li><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#traits">Traits</a></li><li><a href="#functions">Functions</a></li></ul></div><p class='location'><a href='../index.html'>rayon</a></p><script>window.sidebarCurrent = {name: 'iter', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><input class="search-input" name="search" autocomplete="off" placeholder="Click or press S to search, ? for more options…" type="search"><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='in-band'>Module <a href='../index.html'>rayon</a>::<wbr><a class="mod" href=''>iter</a></span><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span><a class='srclink' href='../../src/rayon/iter/mod.rs.html#1-2369' title='goto source code'>[src]</a></span></h1><div class='docblock'><p>Traits for writing parallel programs using an iterator-style interface</p>
<p>You will rarely need to interact with this module directly unless you have
need to name one of the iterator types.</p>
<p>Parallel iterators make it easy to write iterator-like chains that
execute in parallel: typically all you have to do is convert the
first <code>.iter()</code> (or <code>iter_mut()</code>, <code>into_iter()</code>, etc) method into
<code>par_iter()</code> (or <code>par_iter_mut()</code>, <code>into_par_iter()</code>, etc). For
example, to compute the sum of the squares of a sequence of
integers, one might write:</p>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">rayon</span>::<span class="ident">prelude</span>::<span class="kw-2">*</span>;
<span class="kw">fn</span> <span class="ident">sum_of_squares</span>(<span class="ident">input</span>: <span class="kw-2">&amp;</span>[<span class="ident">i32</span>]) <span class="op">-&gt;</span> <span class="ident">i32</span> {
<span class="ident">input</span>.<span class="ident">par_iter</span>()
.<span class="ident">map</span>(<span class="op">|</span><span class="ident">i</span><span class="op">|</span> <span class="ident">i</span> <span class="op">*</span> <span class="ident">i</span>)
.<span class="ident">sum</span>()
}</pre>
<p>Or, to increment all the integers in a slice, you could write:</p>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">rayon</span>::<span class="ident">prelude</span>::<span class="kw-2">*</span>;
<span class="kw">fn</span> <span class="ident">increment_all</span>(<span class="ident">input</span>: <span class="kw-2">&amp;</span><span class="kw-2">mut</span> [<span class="ident">i32</span>]) {
<span class="ident">input</span>.<span class="ident">par_iter_mut</span>()
.<span class="ident">for_each</span>(<span class="op">|</span><span class="ident">p</span><span class="op">|</span> <span class="kw-2">*</span><span class="ident">p</span> <span class="op">+=</span> <span class="number">1</span>);
}</pre>
<p>To use parallel iterators, first import the traits by adding
something like <code>use rayon::prelude::*</code> to your module. You can
then call <code>par_iter</code>, <code>par_iter_mut</code>, or <code>into_par_iter</code> to get a
parallel iterator. Like a <a href="http://doc.rust-lang.org/std/iter/trait.Iterator.html">regular iterator</a>, parallel
iterators work by first constructing a computation and then
executing it.</p>
<p>In addition to <code>par_iter()</code> and friends, some types offer other
ways to create (or consume) parallel iterators:</p>
<ul>
<li>Slices (<code>&amp;[T]</code>, <code>&amp;mut [T]</code>) offer methods like <code>par_split</code> and
<code>par_windows</code>, as well as various parallel sorting
operations. See <a href="../slice/trait.ParallelSlice.html">the <code>ParallelSlice</code> trait</a> for the full list.</li>
<li>Strings (<code>&amp;str</code>) offer methods like <code>par_split</code> and <code>par_lines</code>.
See <a href="../str/trait.ParallelString.html">the <code>ParallelString</code> trait</a> for the full list.</li>
<li>Various collections offer <a href="trait.ParallelExtend.html"><code>par_extend</code></a>, which grows a
collection given a parallel iterator. (If you don't have a
collection to extend, you can use <a href="trait.ParallelIterator.html#method.collect"><code>collect()</code></a> to create a new
one from scratch.)</li>
</ul>
<p>To see the full range of methods available on parallel iterators,
check out the <a href="trait.ParallelIterator.html"><code>ParallelIterator</code></a> and <a href="trait.IndexedParallelIterator.html"><code>IndexedParallelIterator</code></a>
traits.</p>
<p>If you'd like to build a custom parallel iterator, or to write your own
combinator, then check out the <a href="fn.split.html">split</a> function and the <a href="plumbing/index.html">plumbing</a> module.</p>
<p>Note: Several of the <code>ParallelIterator</code> methods rely on a <code>Try</code> trait which
has been deliberately obscured from the public API. This trait is intended
to mirror the unstable <code>std::ops::Try</code> with implementations for <code>Option</code> and
<code>Result</code>, where <code>Some</code>/<code>Ok</code> values will let those iterators continue, but
<code>None</code>/<code>Err</code> values will exit early.</p>
</div><h2 id='modules' class='section-header'><a href="#modules">Modules</a></h2>
<table>
<tr class=' module-item'>
<td><a class="mod" href="plumbing/index.html"
title='mod rayon::iter::plumbing'>plumbing</a></td>
<td class='docblock-short'>
<p>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 <a href="https://github.com/rayon-rs/rayon/blob/master/src/iter/plumbing/README.md">the <code>plumbing</code> README</a> for a high-level overview.</p>
</td>
</tr></table><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
<table>
<tr class=' module-item'>
<td><a class="struct" href="struct.Chain.html"
title='struct rayon::iter::Chain'>Chain</a></td>
<td class='docblock-short'>
<p><code>Chain</code> is an iterator that joins <code>b</code> after <code>a</code> in one continuous iterator.
This struct is created by the <a href="trait.ParallelIterator.html#method.chain"><code>chain()</code></a> method on <a href="trait.ParallelIterator.html"><code>ParallelIterator</code></a></p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="struct" href="struct.Chunks.html"
title='struct rayon::iter::Chunks'>Chunks</a></td>
<td class='docblock-short'>
<p><code>Chunks</code> is an iterator that groups elements of an underlying iterator.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="struct" href="struct.Cloned.html"
title='struct rayon::iter::Cloned'>Cloned</a></td>
<td class='docblock-short'>
<p><code>Cloned</code> is an iterator that clones the elements of an underlying iterator.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="struct" href="struct.Empty.html"
title='struct rayon::iter::Empty'>Empty</a></td>
<td class='docblock-short'>
<p>Iterator adaptor for <a href="fn.empty.html">the <code>empty()</code> function</a>.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="struct" href="struct.Enumerate.html"
title='struct rayon::iter::Enumerate'>Enumerate</a></td>
<td class='docblock-short'>
<p><code>Enumerate</code> is an iterator that returns the current count along with the element.
This struct is created by the <a href="trait.IndexedParallelIterator.html#method.enumerate"><code>enumerate()</code></a> method on <a href="trait.IndexedParallelIterator.html"><code>IndexedParallelIterator</code></a></p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="struct" href="struct.Filter.html"
title='struct rayon::iter::Filter'>Filter</a></td>
<td class='docblock-short'>
<p><code>Filter</code> takes a predicate <code>filter_op</code> and filters out elements that match.
This struct is created by the <a href="trait.ParallelIterator.html#method.filter"><code>filter()</code></a> method on <a href="trait.ParallelIterator.html"><code>ParallelIterator</code></a></p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="struct" href="struct.FilterMap.html"
title='struct rayon::iter::FilterMap'>FilterMap</a></td>
<td class='docblock-short'>
<p><code>FilterMap</code> creates an iterator that uses <code>filter_op</code> to both filter and map elements.
This struct is created by the <a href="trait.ParallelIterator.html#method.filter_map"><code>filter_map()</code></a> method on <a href="trait.ParallelIterator.html"><code>ParallelIterator</code></a>.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="struct" href="struct.FlatMap.html"
title='struct rayon::iter::FlatMap'>FlatMap</a></td>
<td class='docblock-short'>
<p><code>FlatMap</code> maps each element to an iterator, then flattens these iterators together.
This struct is created by the <a href="trait.ParallelIterator.html#method.flat_map"><code>flat_map()</code></a> method on <a href="trait.ParallelIterator.html"><code>ParallelIterator</code></a></p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="struct" href="struct.Flatten.html"
title='struct rayon::iter::Flatten'>Flatten</a></td>
<td class='docblock-short'>
<p><code>Flatten</code> turns each element to an iterator, then flattens these iterators
together. This struct is created by the <a href="trait.ParallelIterator.html#method.flatten"><code>flatten()</code></a> method on
<a href="trait.ParallelIterator.html"><code>ParallelIterator</code></a>.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="struct" href="struct.Fold.html"
title='struct rayon::iter::Fold'>Fold</a></td>
<td class='docblock-short'>
<p><code>Fold</code> is an iterator that applies a function over an iterator producing a single value.
This struct is created by the <a href="trait.ParallelIterator.html#method.fold"><code>fold()</code></a> method on <a href="trait.ParallelIterator.html"><code>ParallelIterator</code></a></p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="struct" href="struct.FoldWith.html"
title='struct rayon::iter::FoldWith'>FoldWith</a></td>
<td class='docblock-short'>
<p><code>FoldWith</code> is an iterator that applies a function over an iterator producing a single value.
This struct is created by the <a href="trait.ParallelIterator.html#method.fold_with"><code>fold_with()</code></a> method on <a href="trait.ParallelIterator.html"><code>ParallelIterator</code></a></p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="struct" href="struct.Inspect.html"
title='struct rayon::iter::Inspect'>Inspect</a></td>
<td class='docblock-short'>
<p><code>Inspect</code> is an iterator that calls a function with a reference to each
element before yielding it.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="struct" href="struct.Interleave.html"
title='struct rayon::iter::Interleave'>Interleave</a></td>
<td class='docblock-short'>
<p><code>Interleave</code> is an iterator that interleaves elements of iterators
<code>i</code> and <code>j</code> in one continuous iterator. This struct is created by
the <a href="trait.IndexedParallelIterator.html#method.interleave"><code>interleave()</code></a> method on <a href="trait.IndexedParallelIterator.html"><code>IndexedParallelIterator</code></a></p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="struct" href="struct.InterleaveShortest.html"
title='struct rayon::iter::InterleaveShortest'>InterleaveShortest</a></td>
<td class='docblock-short'>
<p><code>InterleaveShortest</code> is an iterator that works similarly to
<code>Interleave</code>, but this version stops returning elements once one
of the iterators run out.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="struct" href="struct.Intersperse.html"
title='struct rayon::iter::Intersperse'>Intersperse</a></td>
<td class='docblock-short'>
<p><code>Intersperse</code> is an iterator that inserts a particular item between each
item of the adapted iterator. This struct is created by the
<a href="trait.ParallelIterator.html#method.intersperse"><code>intersperse()</code></a> method on <a href="trait.ParallelIterator.html"><code>ParallelIterator</code></a></p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="struct" href="struct.IterBridge.html"
title='struct rayon::iter::IterBridge'>IterBridge</a></td>
<td class='docblock-short'>
<p><code>IterBridge</code> is a parallel iterator that wraps a sequential iterator.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="struct" href="struct.Map.html"
title='struct rayon::iter::Map'>Map</a></td>
<td class='docblock-short'>
<p><code>Map</code> is an iterator that transforms the elements of an underlying iterator.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="struct" href="struct.MapWith.html"
title='struct rayon::iter::MapWith'>MapWith</a></td>
<td class='docblock-short'>
<p><code>MapWith</code> is an iterator that transforms the elements of an underlying iterator.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="struct" href="struct.MaxLen.html"
title='struct rayon::iter::MaxLen'>MaxLen</a></td>
<td class='docblock-short'>
<p><code>MaxLen</code> is an iterator that imposes a maximum length on iterator splits.
This struct is created by the <a href="trait.IndexedParallelIterator.html#method.max_len"><code>max_len()</code></a> method on <a href="trait.IndexedParallelIterator.html"><code>IndexedParallelIterator</code></a></p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="struct" href="struct.MinLen.html"
title='struct rayon::iter::MinLen'>MinLen</a></td>
<td class='docblock-short'>
<p><code>MinLen</code> is an iterator that imposes a minimum length on iterator splits.
This struct is created by the <a href="trait.IndexedParallelIterator.html#method.min_len"><code>min_len()</code></a> method on <a href="trait.IndexedParallelIterator.html"><code>IndexedParallelIterator</code></a></p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="struct" href="struct.Once.html"
title='struct rayon::iter::Once'>Once</a></td>
<td class='docblock-short'>
<p>Iterator adaptor for <a href="fn.once.html">the <code>once()</code> function</a>.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="struct" href="struct.Repeat.html"
title='struct rayon::iter::Repeat'>Repeat</a></td>
<td class='docblock-short'>
<p>Iterator adaptor for <a href="fn.repeat.html">the <code>repeat()</code> function</a>.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="struct" href="struct.RepeatN.html"
title='struct rayon::iter::RepeatN'>RepeatN</a></td>
<td class='docblock-short'>
<p>Iterator adaptor for <a href="fn.repeatn.html">the <code>repeatn()</code> function</a>.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="struct" href="struct.Rev.html"
title='struct rayon::iter::Rev'>Rev</a></td>
<td class='docblock-short'>
<p><code>Rev</code> is an iterator that produces elements in reverse order. This struct
is created by the <a href="trait.IndexedParallelIterator.html#method.rev"><code>rev()</code></a> method on <a href="trait.IndexedParallelIterator.html"><code>IndexedParallelIterator</code></a></p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="struct" href="struct.Skip.html"
title='struct rayon::iter::Skip'>Skip</a></td>
<td class='docblock-short'>
<p><code>Skip</code> is an iterator that skips over the first <code>n</code> elements.
This struct is created by the <a href="trait.IndexedParallelIterator.html#method.skip"><code>skip()</code></a> method on <a href="trait.IndexedParallelIterator.html"><code>IndexedParallelIterator</code></a></p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="struct" href="struct.Split.html"
title='struct rayon::iter::Split'>Split</a></td>
<td class='docblock-short'>
<p><code>Split</code> is a parallel iterator using arbitrary data and a splitting function.
This struct is created by the <a href="fn.split.html"><code>split()</code></a> function.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="struct" href="struct.Take.html"
title='struct rayon::iter::Take'>Take</a></td>
<td class='docblock-short'>
<p><code>Take</code> is an iterator that iterates over the first <code>n</code> elements.
This struct is created by the <a href="trait.IndexedParallelIterator.html#method.take"><code>take()</code></a> method on <a href="trait.IndexedParallelIterator.html"><code>IndexedParallelIterator</code></a></p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="struct" href="struct.TryFold.html"
title='struct rayon::iter::TryFold'>TryFold</a></td>
<td class='docblock-short'>
<p><code>TryFold</code> is an iterator that applies a function over an iterator producing a single value.
This struct is created by the <a href="trait.ParallelIterator.html#method.try_fold"><code>try_fold()</code></a> method on <a href="trait.ParallelIterator.html"><code>ParallelIterator</code></a></p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="struct" href="struct.TryFoldWith.html"
title='struct rayon::iter::TryFoldWith'>TryFoldWith</a></td>
<td class='docblock-short'>
<p><code>TryFoldWith</code> is an iterator that applies a function over an iterator producing a single value.
This struct is created by the <a href="trait.ParallelIterator.html#method.try_fold_with"><code>try_fold_with()</code></a> method on <a href="trait.ParallelIterator.html"><code>ParallelIterator</code></a></p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="struct" href="struct.Update.html"
title='struct rayon::iter::Update'>Update</a></td>
<td class='docblock-short'>
<p><code>Update</code> is an iterator that mutates the elements of an
underlying iterator before they are yielded.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="struct" href="struct.WhileSome.html"
title='struct rayon::iter::WhileSome'>WhileSome</a></td>
<td class='docblock-short'>
<p><code>WhileSome</code> is an iterator that yields the <code>Some</code> elements of an iterator,
halting as soon as any <code>None</code> is produced.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="struct" href="struct.Zip.html"
title='struct rayon::iter::Zip'>Zip</a></td>
<td class='docblock-short'>
<p><code>Zip</code> is an iterator that zips up <code>a</code> and <code>b</code> into a single iterator
of pairs. This struct is created by the <a href="trait.IndexedParallelIterator.html#method.zip"><code>zip()</code></a> method on
<a href="trait.IndexedParallelIterator.html"><code>IndexedParallelIterator</code></a></p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="struct" href="struct.ZipEq.html"
title='struct rayon::iter::ZipEq'>ZipEq</a></td>
<td class='docblock-short'>
<p>An <a href="trait.IndexedParallelIterator.html"><code>IndexedParallelIterator</code></a> that iterates over two parallel iterators of equal
length simultaneously.</p>
</td>
</tr></table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
<table>
<tr class=' module-item'>
<td><a class="enum" href="enum.Either.html"
title='enum rayon::iter::Either'>Either</a></td>
<td class='docblock-short'>
<p>The enum <code>Either</code> with variants <code>Left</code> and <code>Right</code> is a general purpose
sum type with two cases.</p>
</td>
</tr></table><h2 id='traits' class='section-header'><a href="#traits">Traits</a></h2>
<table>
<tr class=' module-item'>
<td><a class="trait" href="trait.FromParallelIterator.html"
title='trait rayon::iter::FromParallelIterator'>FromParallelIterator</a></td>
<td class='docblock-short'>
<p><code>FromParallelIterator</code> implements the creation of a collection
from a <a href="trait.ParallelIterator.html"><code>ParallelIterator</code></a>. By implementing
<code>FromParallelIterator</code> for a given type, you define how it will be
created from an iterator.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="trait" href="trait.IndexedParallelIterator.html"
title='trait rayon::iter::IndexedParallelIterator'>IndexedParallelIterator</a></td>
<td class='docblock-short'>
<p>An iterator that supports &quot;random access&quot; to its data, meaning
that you can split it at arbitrary indices and draw data from
those points.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="trait" href="trait.IntoParallelIterator.html"
title='trait rayon::iter::IntoParallelIterator'>IntoParallelIterator</a></td>
<td class='docblock-short'>
<p><code>IntoParallelIterator</code> implements the conversion to a <a href="trait.ParallelIterator.html"><code>ParallelIterator</code></a>.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="trait" href="trait.IntoParallelRefIterator.html"
title='trait rayon::iter::IntoParallelRefIterator'>IntoParallelRefIterator</a></td>
<td class='docblock-short'>
<p><code>IntoParallelRefIterator</code> implements the conversion to a
<a href="trait.ParallelIterator.html"><code>ParallelIterator</code></a>, providing shared references to the data.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="trait" href="trait.IntoParallelRefMutIterator.html"
title='trait rayon::iter::IntoParallelRefMutIterator'>IntoParallelRefMutIterator</a></td>
<td class='docblock-short'>
<p><code>IntoParallelRefMutIterator</code> implements the conversion to a
<a href="trait.ParallelIterator.html"><code>ParallelIterator</code></a>, providing mutable references to the data.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="trait" href="trait.ParallelBridge.html"
title='trait rayon::iter::ParallelBridge'>ParallelBridge</a></td>
<td class='docblock-short'>
<p>Conversion trait to convert an <code>Iterator</code> to a <code>ParallelIterator</code>.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="trait" href="trait.ParallelExtend.html"
title='trait rayon::iter::ParallelExtend'>ParallelExtend</a></td>
<td class='docblock-short'>
<p><code>ParallelExtend</code> extends an existing collection with items from a <a href="trait.ParallelIterator.html"><code>ParallelIterator</code></a>.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="trait" href="trait.ParallelIterator.html"
title='trait rayon::iter::ParallelIterator'>ParallelIterator</a></td>
<td class='docblock-short'>
<p>Parallel version of the standard iterator trait.</p>
</td>
</tr></table><h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2>
<table>
<tr class=' module-item'>
<td><a class="fn" href="fn.empty.html"
title='fn rayon::iter::empty'>empty</a></td>
<td class='docblock-short'>
<p>Creates a parallel iterator that produces nothing.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="fn" href="fn.once.html"
title='fn rayon::iter::once'>once</a></td>
<td class='docblock-short'>
<p>Creates a parallel iterator that produces an element exactly once.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="fn" href="fn.repeat.html"
title='fn rayon::iter::repeat'>repeat</a></td>
<td class='docblock-short'>
<p>Creates a parallel iterator that endlessly repeats <code>elt</code> (by
cloning it). Note that this iterator has &quot;infinite&quot; length, so
typically you would want to use <code>zip</code> or <code>take</code> or some other
means to shorten it, or consider using
<a href="fn.repeatn.html">the <code>repeatn()</code> function</a> instead.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="fn" href="fn.repeatn.html"
title='fn rayon::iter::repeatn'>repeatn</a></td>
<td class='docblock-short'>
<p>Creates a parallel iterator that produces <code>n</code> repeats of <code>elt</code>
(by cloning it).</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="fn" href="fn.split.html"
title='fn rayon::iter::split'>split</a></td>
<td class='docblock-short'>
<p>The <code>split</code> function takes arbitrary data and a closure that knows how to
split it, and turns this into a <code>ParallelIterator</code>.</p>
</td>
</tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd></kbd></dt><dd>Move up in search results</dd><dt><kbd></kbd></dt><dd>Move down in search results</dd><dt><kbd></kbd></dt><dd>Switch tab</dd><dt><kbd>&#9166;</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g. <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g. <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../";window.currentCrate = "rayon";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>