blob: 555e503822b2217a145e44704cd379269c6d2f84 [file] [log] [blame]
<!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="Traits for writing parallel programs using an iterator-style interface"><meta name="keywords" content="rust, rustlang, rust-lang, iter"><title>rayon::iter - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="../../normalize.css"><link rel="stylesheet" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../../ayu.css" disabled><link rel="stylesheet" href="../../dark.css" disabled><link rel="stylesheet" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script defer src="../../main.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../../rayon/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../rayon/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">Module iter</a></h2><div class="sidebar-elems"><section><ul class="block"><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></section></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn">Module <a href="../index.html">rayon</a>::<wbr><a class="mod" href="#">iter</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="srclink" href="../../src/rayon/iter/mod.rs.html#1-3531">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><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>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>rayon::prelude::<span class="kw-2">*</span>;
<span class="kw">fn </span>sum_of_squares(input: <span class="kw-2">&amp;</span>[i32]) -&gt; i32 {
input.par_iter()
.map(|i| i * i)
.sum()
}</code></pre></div>
<p>Or, to increment all the integers in a slice, you could write:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>rayon::prelude::<span class="kw-2">*</span>;
<span class="kw">fn </span>increment_all(input: <span class="kw-2">&amp;mut </span>[i32]) {
input.par_iter_mut()
.for_each(|p| <span class="kw-2">*</span>p += <span class="number">1</span>);
}</code></pre></div>
<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="https://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>
<p>A note about object safety: It is currently <em>not</em> possible to wrap
a <code>ParallelIterator</code> (or any trait that depends on it) using a
<code>Box&lt;dyn ParallelIterator&gt;</code> or other kind of dynamic allocation,
because <code>ParallelIterator</code> is <strong>not object-safe</strong>.
(This keeps the implementation simpler and allows extra optimizations.)</p>
</div></details><h2 id="modules" class="small-section-header"><a href="#modules">Modules</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="mod" href="plumbing/index.html" title="rayon::iter::plumbing mod">plumbing</a></div><div class="item-right docblock-short">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 general overview.</div></div></div><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Chain.html" title="rayon::iter::Chain struct">Chain</a></div><div class="item-right docblock-short"><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></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Chunks.html" title="rayon::iter::Chunks struct">Chunks</a></div><div class="item-right docblock-short"><code>Chunks</code> is an iterator that groups elements of an underlying iterator.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Cloned.html" title="rayon::iter::Cloned struct">Cloned</a></div><div class="item-right docblock-short"><code>Cloned</code> is an iterator that clones the elements of an underlying iterator.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Copied.html" title="rayon::iter::Copied struct">Copied</a></div><div class="item-right docblock-short"><code>Copied</code> is an iterator that copies the elements of an underlying iterator.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Empty.html" title="rayon::iter::Empty struct">Empty</a></div><div class="item-right docblock-short">Iterator adaptor for <a href="fn.empty.html">the <code>empty()</code> function</a>.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Enumerate.html" title="rayon::iter::Enumerate struct">Enumerate</a></div><div class="item-right docblock-short"><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></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Filter.html" title="rayon::iter::Filter struct">Filter</a></div><div class="item-right docblock-short"><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></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.FilterMap.html" title="rayon::iter::FilterMap struct">FilterMap</a></div><div class="item-right docblock-short"><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>.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.FlatMap.html" title="rayon::iter::FlatMap struct">FlatMap</a></div><div class="item-right docblock-short"><code>FlatMap</code> maps each element to a parallel 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></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.FlatMapIter.html" title="rayon::iter::FlatMapIter struct">FlatMapIter</a></div><div class="item-right docblock-short"><code>FlatMapIter</code> maps each element to a serial iterator, then flattens these iterators together.
This struct is created by the <a href="trait.ParallelIterator.html#method.flat_map_iter"><code>flat_map_iter()</code></a> method on <a href="trait.ParallelIterator.html"><code>ParallelIterator</code></a></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Flatten.html" title="rayon::iter::Flatten struct">Flatten</a></div><div class="item-right docblock-short"><code>Flatten</code> turns each element to a parallel 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>.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.FlattenIter.html" title="rayon::iter::FlattenIter struct">FlattenIter</a></div><div class="item-right docblock-short"><code>FlattenIter</code> turns each element to a serial iterator, then flattens these iterators
together. This struct is created by the <a href="trait.ParallelIterator.html#method.flatten_iter"><code>flatten_iter()</code></a> method on <a href="trait.ParallelIterator.html"><code>ParallelIterator</code></a>.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Fold.html" title="rayon::iter::Fold struct">Fold</a></div><div class="item-right docblock-short"><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></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.FoldChunks.html" title="rayon::iter::FoldChunks struct">FoldChunks</a></div><div class="item-right docblock-short"><code>FoldChunks</code> is an iterator that groups elements of an underlying iterator and applies a
function over them, producing a single value for each group.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.FoldChunksWith.html" title="rayon::iter::FoldChunksWith struct">FoldChunksWith</a></div><div class="item-right docblock-short"><code>FoldChunksWith</code> is an iterator that groups elements of an underlying iterator and applies a
function over them, producing a single value for each group.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.FoldWith.html" title="rayon::iter::FoldWith struct">FoldWith</a></div><div class="item-right docblock-short"><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></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Inspect.html" title="rayon::iter::Inspect struct">Inspect</a></div><div class="item-right docblock-short"><code>Inspect</code> is an iterator that calls a function with a reference to each
element before yielding it.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Interleave.html" title="rayon::iter::Interleave struct">Interleave</a></div><div class="item-right docblock-short"><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></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.InterleaveShortest.html" title="rayon::iter::InterleaveShortest struct">InterleaveShortest</a></div><div class="item-right docblock-short"><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.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Intersperse.html" title="rayon::iter::Intersperse struct">Intersperse</a></div><div class="item-right docblock-short"><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></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.IterBridge.html" title="rayon::iter::IterBridge struct">IterBridge</a></div><div class="item-right docblock-short"><code>IterBridge</code> is a parallel iterator that wraps a sequential iterator.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Map.html" title="rayon::iter::Map struct">Map</a></div><div class="item-right docblock-short"><code>Map</code> is an iterator that transforms the elements of an underlying iterator.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.MapInit.html" title="rayon::iter::MapInit struct">MapInit</a></div><div class="item-right docblock-short"><code>MapInit</code> is an iterator that transforms the elements of an underlying iterator.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.MapWith.html" title="rayon::iter::MapWith struct">MapWith</a></div><div class="item-right docblock-short"><code>MapWith</code> is an iterator that transforms the elements of an underlying iterator.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.MaxLen.html" title="rayon::iter::MaxLen struct">MaxLen</a></div><div class="item-right docblock-short"><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.with_max_len"><code>with_max_len()</code></a> method on <a href="trait.IndexedParallelIterator.html"><code>IndexedParallelIterator</code></a></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.MinLen.html" title="rayon::iter::MinLen struct">MinLen</a></div><div class="item-right docblock-short"><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.with_min_len"><code>with_min_len()</code></a> method on <a href="trait.IndexedParallelIterator.html"><code>IndexedParallelIterator</code></a></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.MultiZip.html" title="rayon::iter::MultiZip struct">MultiZip</a></div><div class="item-right docblock-short"><code>MultiZip</code> is an iterator that zips up a tuple of parallel iterators to
produce tuples of their items.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Once.html" title="rayon::iter::Once struct">Once</a></div><div class="item-right docblock-short">Iterator adaptor for <a href="fn.once.html">the <code>once()</code> function</a>.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.PanicFuse.html" title="rayon::iter::PanicFuse struct">PanicFuse</a></div><div class="item-right docblock-short"><code>PanicFuse</code> is an adaptor that wraps an iterator with a fuse in case
of panics, to halt all threads as soon as possible.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Positions.html" title="rayon::iter::Positions struct">Positions</a></div><div class="item-right docblock-short"><code>Positions</code> takes a predicate <code>predicate</code> and filters out elements that match,
yielding their indices.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Repeat.html" title="rayon::iter::Repeat struct">Repeat</a></div><div class="item-right docblock-short">Iterator adaptor for <a href="fn.repeat.html">the <code>repeat()</code> function</a>.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.RepeatN.html" title="rayon::iter::RepeatN struct">RepeatN</a></div><div class="item-right docblock-short">Iterator adaptor for <a href="fn.repeatn.html">the <code>repeatn()</code> function</a>.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Rev.html" title="rayon::iter::Rev struct">Rev</a></div><div class="item-right docblock-short"><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></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Skip.html" title="rayon::iter::Skip struct">Skip</a></div><div class="item-right docblock-short"><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></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.SkipAny.html" title="rayon::iter::SkipAny struct">SkipAny</a></div><div class="item-right docblock-short"><code>SkipAny</code> is an iterator that skips over <code>n</code> elements from anywhere in <code>I</code>.
This struct is created by the <a href="trait.ParallelIterator.html#method.skip_any"><code>skip_any()</code></a> method on <a href="trait.ParallelIterator.html"><code>ParallelIterator</code></a></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.SkipAnyWhile.html" title="rayon::iter::SkipAnyWhile struct">SkipAnyWhile</a></div><div class="item-right docblock-short"><code>SkipAnyWhile</code> is an iterator that skips over elements from anywhere in <code>I</code>
until the callback returns <code>false</code>.
This struct is created by the <a href="trait.ParallelIterator.html#method.skip_any_while"><code>skip_any_while()</code></a> method on <a href="trait.ParallelIterator.html"><code>ParallelIterator</code></a></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Split.html" title="rayon::iter::Split struct">Split</a></div><div class="item-right docblock-short"><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.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.StepBy.html" title="rayon::iter::StepBy struct">StepBy</a></div><div class="item-right docblock-short"><code>StepBy</code> is an iterator that skips <code>n</code> elements between each yield, where <code>n</code> is the given step.
This struct is created by the <a href="trait.IndexedParallelIterator.html#method.step_by"><code>step_by()</code></a> method on <a href="trait.IndexedParallelIterator.html"><code>IndexedParallelIterator</code></a></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Take.html" title="rayon::iter::Take struct">Take</a></div><div class="item-right docblock-short"><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></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.TakeAny.html" title="rayon::iter::TakeAny struct">TakeAny</a></div><div class="item-right docblock-short"><code>TakeAny</code> is an iterator that iterates over <code>n</code> elements from anywhere in <code>I</code>.
This struct is created by the <a href="trait.ParallelIterator.html#method.take_any"><code>take_any()</code></a> method on <a href="trait.ParallelIterator.html"><code>ParallelIterator</code></a></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.TakeAnyWhile.html" title="rayon::iter::TakeAnyWhile struct">TakeAnyWhile</a></div><div class="item-right docblock-short"><code>TakeAnyWhile</code> is an iterator that iterates over elements from anywhere in <code>I</code>
until the callback returns <code>false</code>.
This struct is created by the <a href="trait.ParallelIterator.html#method.take_any_while"><code>take_any_while()</code></a> method on <a href="trait.ParallelIterator.html"><code>ParallelIterator</code></a></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.TryFold.html" title="rayon::iter::TryFold struct">TryFold</a></div><div class="item-right docblock-short"><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></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.TryFoldWith.html" title="rayon::iter::TryFoldWith struct">TryFoldWith</a></div><div class="item-right docblock-short"><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></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Update.html" title="rayon::iter::Update struct">Update</a></div><div class="item-right docblock-short"><code>Update</code> is an iterator that mutates the elements of an
underlying iterator before they are yielded.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.WhileSome.html" title="rayon::iter::WhileSome struct">WhileSome</a></div><div class="item-right docblock-short"><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.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Zip.html" title="rayon::iter::Zip struct">Zip</a></div><div class="item-right docblock-short"><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></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ZipEq.html" title="rayon::iter::ZipEq struct">ZipEq</a></div><div class="item-right docblock-short">An <a href="trait.IndexedParallelIterator.html"><code>IndexedParallelIterator</code></a> that iterates over two parallel iterators of equal
length simultaneously.</div></div></div><h2 id="enums" class="small-section-header"><a href="#enums">Enums</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="enum" href="enum.Either.html" title="rayon::iter::Either enum">Either</a></div><div class="item-right docblock-short">The enum <code>Either</code> with variants <code>Left</code> and <code>Right</code> is a general purpose
sum type with two cases.</div></div></div><h2 id="traits" class="small-section-header"><a href="#traits">Traits</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.FromParallelIterator.html" title="rayon::iter::FromParallelIterator trait">FromParallelIterator</a></div><div class="item-right docblock-short"><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.</div></div><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.IndexedParallelIterator.html" title="rayon::iter::IndexedParallelIterator trait">IndexedParallelIterator</a></div><div class="item-right docblock-short">An iterator that supports “random access” to its data, meaning
that you can split it at arbitrary indices and draw data from
those points.</div></div><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.IntoParallelIterator.html" title="rayon::iter::IntoParallelIterator trait">IntoParallelIterator</a></div><div class="item-right docblock-short"><code>IntoParallelIterator</code> implements the conversion to a <a href="trait.ParallelIterator.html"><code>ParallelIterator</code></a>.</div></div><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.IntoParallelRefIterator.html" title="rayon::iter::IntoParallelRefIterator trait">IntoParallelRefIterator</a></div><div class="item-right docblock-short"><code>IntoParallelRefIterator</code> implements the conversion to a
<a href="trait.ParallelIterator.html"><code>ParallelIterator</code></a>, providing shared references to the data.</div></div><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.IntoParallelRefMutIterator.html" title="rayon::iter::IntoParallelRefMutIterator trait">IntoParallelRefMutIterator</a></div><div class="item-right docblock-short"><code>IntoParallelRefMutIterator</code> implements the conversion to a
<a href="trait.ParallelIterator.html"><code>ParallelIterator</code></a>, providing mutable references to the data.</div></div><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.ParallelBridge.html" title="rayon::iter::ParallelBridge trait">ParallelBridge</a></div><div class="item-right docblock-short">Conversion trait to convert an <code>Iterator</code> to a <code>ParallelIterator</code>.</div></div><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.ParallelDrainFull.html" title="rayon::iter::ParallelDrainFull trait">ParallelDrainFull</a></div><div class="item-right docblock-short"><code>ParallelDrainFull</code> creates a parallel iterator that moves all items
from a collection while retaining the original capacity.</div></div><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.ParallelDrainRange.html" title="rayon::iter::ParallelDrainRange trait">ParallelDrainRange</a></div><div class="item-right docblock-short"><code>ParallelDrainRange</code> creates a parallel iterator that moves a range of items
from a collection while retaining the original capacity.</div></div><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.ParallelExtend.html" title="rayon::iter::ParallelExtend trait">ParallelExtend</a></div><div class="item-right docblock-short"><code>ParallelExtend</code> extends an existing collection with items from a <a href="trait.ParallelIterator.html"><code>ParallelIterator</code></a>.</div></div><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.ParallelIterator.html" title="rayon::iter::ParallelIterator trait">ParallelIterator</a></div><div class="item-right docblock-short">Parallel version of the standard iterator trait.</div></div></div><h2 id="functions" class="small-section-header"><a href="#functions">Functions</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.empty.html" title="rayon::iter::empty fn">empty</a></div><div class="item-right docblock-short">Creates a parallel iterator that produces nothing.</div></div><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.once.html" title="rayon::iter::once fn">once</a></div><div class="item-right docblock-short">Creates a parallel iterator that produces an element exactly once.</div></div><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.repeat.html" title="rayon::iter::repeat fn">repeat</a></div><div class="item-right docblock-short">Creates a parallel iterator that endlessly repeats <code>elt</code> (by
cloning it). Note that this iterator has “infinite” 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.</div></div><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.repeatn.html" title="rayon::iter::repeatn fn">repeatn</a></div><div class="item-right docblock-short">Creates a parallel iterator that produces <code>n</code> repeats of <code>elt</code>
(by cloning it).</div></div><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.split.html" title="rayon::iter::split fn">split</a></div><div class="item-right docblock-short">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>.</div></div></div></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="rayon" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.66.0-nightly (5c8bff74b 2022-10-21)" ></div></body></html>