Files
GopherGate/target/doc/rayon/struct.ThreadPool.html
2026-02-26 12:00:21 -05:00

201 lines
62 KiB
HTML
Raw 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="Represents a user-created thread pool."><title>ThreadPool in rayon - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="rayon" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">ThreadPool</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../rayon/index.html">rayon</a><span class="version">1.11.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Thread<wbr>Pool</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#creating-a-threadpool" title="Creating a ThreadPool">Creating a ThreadPool</a></li></ul><h3><a href="#implementations">Methods</a></h3><ul class="block method"><li><a href="#method.broadcast" title="broadcast">broadcast</a></li><li><a href="#method.current_num_threads" title="current_num_threads">current_num_threads</a></li><li><a href="#method.current_thread_has_pending_tasks" title="current_thread_has_pending_tasks">current_thread_has_pending_tasks</a></li><li><a href="#method.current_thread_index" title="current_thread_index">current_thread_index</a></li><li><a href="#method.in_place_scope" title="in_place_scope">in_place_scope</a></li><li><a href="#method.in_place_scope_fifo" title="in_place_scope_fifo">in_place_scope_fifo</a></li><li><a href="#method.install" title="install">install</a></li><li><a href="#method.join" title="join">join</a></li><li><a href="#method.new" title="new">new</a></li><li><a href="#method.scope" title="scope">scope</a></li><li><a href="#method.scope_fifo" title="scope_fifo">scope_fifo</a></li><li><a href="#method.spawn" title="spawn">spawn</a></li><li><a href="#method.spawn_broadcast" title="spawn_broadcast">spawn_broadcast</a></li><li><a href="#method.spawn_fifo" title="spawn_fifo">spawn_fifo</a></li><li><a href="#method.yield_local" title="yield_local">yield_local</a></li><li><a href="#method.yield_now" title="yield_now">yield_now</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-Debug-for-ThreadPool" title="Debug">Debug</a></li><li><a href="#impl-Drop-for-ThreadPool" title="Drop">Drop</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-RefUnwindSafe-for-ThreadPool" title="!RefUnwindSafe">!RefUnwindSafe</a></li><li><a href="#impl-UnwindSafe-for-ThreadPool" title="!UnwindSafe">!UnwindSafe</a></li><li><a href="#impl-Freeze-for-ThreadPool" title="Freeze">Freeze</a></li><li><a href="#impl-Send-for-ThreadPool" title="Send">Send</a></li><li><a href="#impl-Sync-for-ThreadPool" title="Sync">Sync</a></li><li><a href="#impl-Unpin-for-ThreadPool" title="Unpin">Unpin</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block blanket-implementation"><li><a href="#impl-Any-for-T" title="Any">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-T" title="Borrow&#60;T&#62;">Borrow&#60;T&#62;</a></li><li><a href="#impl-BorrowMut%3CT%3E-for-T" title="BorrowMut&#60;T&#62;">BorrowMut&#60;T&#62;</a></li><li><a href="#impl-From%3CT%3E-for-T" title="From&#60;T&#62;">From&#60;T&#62;</a></li><li><a href="#impl-Into%3CU%3E-for-T" title="Into&#60;U&#62;">Into&#60;U&#62;</a></li><li><a href="#impl-IntoEither-for-T" title="IntoEither">IntoEither</a></li><li><a href="#impl-Pointable-for-T" title="Pointable">Pointable</a></li><li><a href="#impl-TryFrom%3CU%3E-for-T" title="TryFrom&#60;U&#62;">TryFrom&#60;U&#62;</a></li><li><a href="#impl-TryInto%3CU%3E-for-T" title="TryInto&#60;U&#62;">TryInto&#60;U&#62;</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate rayon</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">rayon</a></div><h1>Struct <span class="struct">Thread<wbr>Pool</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/rayon_core/thread_pool/mod.rs.html#46">Source</a> </span></div><pre class="rust item-decl"><code>pub struct ThreadPool { <span class="comment">/* private fields */</span> }</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Represents a user-created <a href="https://en.wikipedia.org/wiki/Thread_pool">thread pool</a>.</p>
<p>Use a <a href="struct.ThreadPoolBuilder.html" title="struct rayon::ThreadPoolBuilder"><code>ThreadPoolBuilder</code></a> to specify the number and/or names of threads
in the pool. After calling <a href="struct.ThreadPoolBuilder.html#method.build" title="method rayon::ThreadPoolBuilder::build"><code>ThreadPoolBuilder::build()</code></a>, you can then
execute functions explicitly within this <a href="struct.ThreadPool.html" title="struct rayon::ThreadPool"><code>ThreadPool</code></a> using
<a href="struct.ThreadPool.html#method.install" title="method rayon::ThreadPool::install"><code>ThreadPool::install()</code></a>. By contrast, top-level rayon functions
(like <code>join()</code>) will execute implicitly within the current thread pool.</p>
<h3 id="creating-a-threadpool"><a class="doc-anchor" href="#creating-a-threadpool">§</a>Creating a ThreadPool</h3>
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested on wasm"></a><pre class="rust rust-example-rendered"><code><span class="kw">let </span>pool = rayon::ThreadPoolBuilder::new().num_threads(<span class="number">8</span>).build().unwrap();</code></pre></div>
<p><a href="struct.ThreadPool.html#method.install" title="method rayon::ThreadPool::install"><code>install()</code></a> executes a closure in one of the <code>ThreadPool</code>s
threads. In addition, any other rayon operations called inside of <code>install()</code> will also
execute in the context of the <code>ThreadPool</code>.</p>
<p>When the <code>ThreadPool</code> is dropped, thats a signal for the threads it manages to terminate,
they will complete executing any remaining work that you have spawned, and automatically
terminate.</p>
</div></details><h2 id="implementations" class="section-header">Implementations<a href="#implementations" class="anchor">§</a></h2><div id="implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-ThreadPool" class="impl"><a class="src rightside" href="../src/rayon_core/thread_pool/mod.rs.html#50">Source</a><a href="#impl-ThreadPool" class="anchor">§</a><h3 class="code-header">impl <a class="struct" href="struct.ThreadPool.html" title="struct rayon::ThreadPool">ThreadPool</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.new" class="method"><a class="src rightside" href="../src/rayon_core/thread_pool/mod.rs.html#54">Source</a><h4 class="code-header">pub fn <a href="#method.new" class="fn">new</a>(configuration: <a class="struct" href="../rayon_core/struct.Configuration.html" title="struct rayon_core::Configuration">Configuration</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="struct.ThreadPool.html" title="struct rayon::ThreadPool">ThreadPool</a>, <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/error/trait.Error.html" title="trait core::error::Error">Error</a>&gt;&gt;</h4></section><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated: Use <code>ThreadPoolBuilder::build</code></span></div></span></summary><div class="docblock"><p>Deprecated in favor of <code>ThreadPoolBuilder::build</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.install" class="method"><a class="src rightside" href="../src/rayon_core/thread_pool/mod.rs.html#137-140">Source</a><h4 class="code-header">pub fn <a href="#method.install" class="fn">install</a>&lt;OP, R&gt;(&amp;self, op: OP) -&gt; R<div class="where">where
OP: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>() -&gt; R + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,
R: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,</div></h4></section></summary><div class="docblock"><p>Executes <code>op</code> within the thread pool. Any attempts to use
<code>join</code>, <code>scope</code>, or parallel iterators will then operate
within that thread pool.</p>
<h5 id="warning-thread-local-data"><a class="doc-anchor" href="#warning-thread-local-data">§</a>Warning: thread-local data</h5>
<p>Because <code>op</code> is executing within the Rayon thread pool,
thread-local data from the current thread will not be
accessible.</p>
<h5 id="warning-execution-order"><a class="doc-anchor" href="#warning-execution-order">§</a>Warning: execution order</h5>
<p>If the current thread is part of a different thread pool, it will try to
keep busy while the <code>op</code> completes in its target pool, similar to
calling <a href="struct.ThreadPool.html#method.yield_now" title="method rayon::ThreadPool::yield_now"><code>ThreadPool::yield_now()</code></a> in a loop. Therefore, it may
potentially schedule other tasks to run on the current thread in the
meantime. For example</p>
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested on wasm"></a><pre class="rust rust-example-rendered"><code><span class="kw">fn </span>main() {
rayon::ThreadPoolBuilder::new().num_threads(<span class="number">1</span>).build_global().unwrap();
<span class="kw">let </span>pool = rayon_core::ThreadPoolBuilder::default().build().unwrap();
<span class="kw">let </span>do_it = || {
<span class="macro">print!</span>(<span class="string">"one "</span>);
pool.install(||{});
<span class="macro">print!</span>(<span class="string">"two "</span>);
};
rayon::join(|| do_it(), || do_it());
}</code></pre></div>
<p>Since we configured just one thread in the global pool, one might
expect <code>do_it()</code> to run sequentially, producing:</p>
<div class="example-wrap"><pre class="language-ascii"><code>one two one two</code></pre></div>
<p>However each call to <code>install()</code> yields implicitly, allowing rayon to
run multiple instances of <code>do_it()</code> concurrently on the single, global
thread. The following output would be equally valid:</p>
<div class="example-wrap"><pre class="language-ascii"><code>one one two two</code></pre></div><h5 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h5>
<p>If <code>op</code> should panic, that panic will be propagated.</p>
<h6 id="using-install"><a class="doc-anchor" href="#using-install">§</a>Using <code>install()</code></h6>
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested on wasm"></a><pre class="rust rust-example-rendered"><code> <span class="kw">fn </span>main() {
<span class="kw">let </span>pool = rayon::ThreadPoolBuilder::new().num_threads(<span class="number">8</span>).build().unwrap();
<span class="kw">let </span>n = pool.install(|| fib(<span class="number">20</span>));
<span class="macro">println!</span>(<span class="string">"{}"</span>, n);
}
<span class="kw">fn </span>fib(n: usize) -&gt; usize {
<span class="kw">if </span>n == <span class="number">0 </span>|| n == <span class="number">1 </span>{
<span class="kw">return </span>n;
}
<span class="kw">let </span>(a, b) = rayon::join(|| fib(n - <span class="number">1</span>), || fib(n - <span class="number">2</span>)); <span class="comment">// runs inside of `pool`
</span><span class="kw">return </span>a + b;
}</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.broadcast" class="method"><a class="src rightside" href="../src/rayon_core/thread_pool/mod.rs.html#187-190">Source</a><h4 class="code-header">pub fn <a href="#method.broadcast" class="fn">broadcast</a>&lt;OP, R&gt;(&amp;self, op: OP) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;R&gt;<div class="where">where
OP: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(<a class="struct" href="struct.BroadcastContext.html" title="struct rayon::BroadcastContext">BroadcastContext</a>&lt;'_&gt;) -&gt; R + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,
R: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,</div></h4></section></summary><div class="docblock"><p>Executes <code>op</code> within every thread in the thread pool. Any attempts to use
<code>join</code>, <code>scope</code>, or parallel iterators will then operate within that
thread pool.</p>
<p>Broadcasts are executed on each thread after they have exhausted their
local work queue, before they attempt work-stealing from other threads.
The goal of that strategy is to run everywhere in a timely manner
<em>without</em> being too disruptive to current work. There may be alternative
broadcast styles added in the future for more or less aggressive
injection, if the need arises.</p>
<h5 id="warning-thread-local-data-1"><a class="doc-anchor" href="#warning-thread-local-data-1">§</a>Warning: thread-local data</h5>
<p>Because <code>op</code> is executing within the Rayon thread pool,
thread-local data from the current thread will not be
accessible.</p>
<h5 id="panics-1"><a class="doc-anchor" href="#panics-1">§</a>Panics</h5>
<p>If <code>op</code> should panic on one or more threads, exactly one panic
will be propagated, only after all threads have completed
(or panicked) their own <code>op</code>.</p>
<h5 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h5>
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested on wasm"></a><pre class="rust rust-example-rendered"><code> <span class="kw">use </span>std::sync::atomic::{AtomicUsize, Ordering};
<span class="kw">fn </span>main() {
<span class="kw">let </span>pool = rayon::ThreadPoolBuilder::new().num_threads(<span class="number">5</span>).build().unwrap();
<span class="comment">// The argument gives context, including the index of each thread.
</span><span class="kw">let </span>v: Vec&lt;usize&gt; = pool.broadcast(|ctx| ctx.index() * ctx.index());
<span class="macro">assert_eq!</span>(v, <span class="kw-2">&amp;</span>[<span class="number">0</span>, <span class="number">1</span>, <span class="number">4</span>, <span class="number">9</span>, <span class="number">16</span>]);
<span class="comment">// The closure can reference the local stack
</span><span class="kw">let </span>count = AtomicUsize::new(<span class="number">0</span>);
pool.broadcast(|<span class="kw">_</span>| count.fetch_add(<span class="number">1</span>, Ordering::Relaxed));
<span class="macro">assert_eq!</span>(count.into_inner(), <span class="number">5</span>);
}</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.current_num_threads" class="method"><a class="src rightside" href="../src/rayon_core/thread_pool/mod.rs.html#207">Source</a><h4 class="code-header">pub fn <a href="#method.current_num_threads" class="fn">current_num_threads</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>Returns the (current) number of threads in the thread pool.</p>
<h5 id="future-compatibility-note"><a class="doc-anchor" href="#future-compatibility-note">§</a>Future compatibility note</h5>
<p>Note that unless this thread pool was created with a
<a href="struct.ThreadPoolBuilder.html" title="struct rayon::ThreadPoolBuilder"><code>ThreadPoolBuilder</code></a> that specifies the number of threads,
then this number may vary over time in future versions (see <a href="struct.ThreadPoolBuilder.html#method.num_threads" title="method rayon::ThreadPoolBuilder::num_threads">the
<code>num_threads()</code> method for details</a>).</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.current_thread_index" class="method"><a class="src rightside" href="../src/rayon_core/thread_pool/mod.rs.html#232">Source</a><h4 class="code-header">pub fn <a href="#method.current_thread_index" class="fn">current_thread_index</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>&gt;</h4></section></summary><div class="docblock"><p>If called from a Rayon worker thread in this thread pool,
returns the index of that thread; if not called from a Rayon
thread, or called from a Rayon thread that belongs to a
different thread pool, returns <code>None</code>.</p>
<p>The index for a given thread will not change over the threads
lifetime. However, multiple threads may share the same index if
they are in distinct thread pools.</p>
<h5 id="future-compatibility-note-1"><a class="doc-anchor" href="#future-compatibility-note-1">§</a>Future compatibility note</h5>
<p>Currently, every thread pool (including the global
thread pool) has a fixed number of threads, but this may
change in future Rayon versions (see <a href="struct.ThreadPoolBuilder.html#method.num_threads" title="method rayon::ThreadPoolBuilder::num_threads">the <code>num_threads()</code> method
for details</a>). In that case, the index for a
thread would not change during its lifetime, but thread
indices may wind up being reused if threads are terminated and
restarted.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.current_thread_has_pending_tasks" class="method"><a class="src rightside" href="../src/rayon_core/thread_pool/mod.rs.html#259">Source</a><h4 class="code-header">pub fn <a href="#method.current_thread_has_pending_tasks" class="fn">current_thread_has_pending_tasks</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.bool.html">bool</a>&gt;</h4></section></summary><div class="docblock"><p>Returns true if the current worker thread currently has “local
tasks” pending. This can be useful as part of a heuristic for
deciding whether to spawn a new task or execute code on the
current thread, particularly in breadth-first
schedulers. However, keep in mind that this is an inherently
racy check, as other worker threads may be actively “stealing”
tasks from our local deque.</p>
<p><strong>Background:</strong> Rayons uses a <a href="https://en.wikipedia.org/wiki/Work_stealing">work-stealing</a> scheduler. The
key idea is that each thread has its own <a href="https://en.wikipedia.org/wiki/Double-ended_queue">deque</a> of
tasks. Whenever a new task is spawned whether through
<code>join()</code>, <code>Scope::spawn()</code>, or some other means that new
task is pushed onto the threads <em>local</em> deque. Worker threads
have a preference for executing their own tasks; if however
they run out of tasks, they will go try to “steal” tasks from
other threads. This function therefore has an inherent race
with other active worker threads, which may be removing items
from the local deque.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.join" class="method"><a class="src rightside" href="../src/rayon_core/thread_pool/mod.rs.html#267-272">Source</a><h4 class="code-header">pub fn <a href="#method.join" class="fn">join</a>&lt;A, B, RA, RB&gt;(&amp;self, oper_a: A, oper_b: B) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.tuple.html">(RA, RB)</a><div class="where">where
A: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>() -&gt; RA + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,
B: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>() -&gt; RB + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,
RA: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,
RB: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,</div></h4></section></summary><div class="docblock"><p>Execute <code>oper_a</code> and <code>oper_b</code> in the thread pool and return
the results. Equivalent to <code>self.install(|| join(oper_a, oper_b))</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.scope" class="method"><a class="src rightside" href="../src/rayon_core/thread_pool/mod.rs.html#283-286">Source</a><h4 class="code-header">pub fn <a href="#method.scope" class="fn">scope</a>&lt;'scope, OP, R&gt;(&amp;self, op: OP) -&gt; R<div class="where">where
OP: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;<a class="struct" href="struct.Scope.html" title="struct rayon::Scope">Scope</a>&lt;'scope&gt;) -&gt; R + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,
R: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,</div></h4></section></summary><div class="docblock"><p>Creates a scope that executes within this thread pool.
Equivalent to <code>self.install(|| scope(...))</code>.</p>
<p>See also: <a href="fn.scope.html" title="fn rayon::scope">the <code>scope()</code> function</a>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.scope_fifo" class="method"><a class="src rightside" href="../src/rayon_core/thread_pool/mod.rs.html#298-301">Source</a><h4 class="code-header">pub fn <a href="#method.scope_fifo" class="fn">scope_fifo</a>&lt;'scope, OP, R&gt;(&amp;self, op: OP) -&gt; R<div class="where">where
OP: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;<a class="struct" href="struct.ScopeFifo.html" title="struct rayon::ScopeFifo">ScopeFifo</a>&lt;'scope&gt;) -&gt; R + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,
R: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,</div></h4></section></summary><div class="docblock"><p>Creates a scope that executes within this thread pool.
Spawns from the same thread are prioritized in relative FIFO order.
Equivalent to <code>self.install(|| scope_fifo(...))</code>.</p>
<p>See also: <a href="fn.scope_fifo.html" title="fn rayon::scope_fifo">the <code>scope_fifo()</code> function</a>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.in_place_scope" class="method"><a class="src rightside" href="../src/rayon_core/thread_pool/mod.rs.html#311-313">Source</a><h4 class="code-header">pub fn <a href="#method.in_place_scope" class="fn">in_place_scope</a>&lt;'scope, OP, R&gt;(&amp;self, op: OP) -&gt; R<div class="where">where
OP: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;<a class="struct" href="struct.Scope.html" title="struct rayon::Scope">Scope</a>&lt;'scope&gt;) -&gt; R,</div></h4></section></summary><div class="docblock"><p>Creates a scope that spawns work into this thread pool.</p>
<p>See also: <a href="fn.in_place_scope.html" title="fn rayon::in_place_scope">the <code>in_place_scope()</code> function</a>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.in_place_scope_fifo" class="method"><a class="src rightside" href="../src/rayon_core/thread_pool/mod.rs.html#323-325">Source</a><h4 class="code-header">pub fn <a href="#method.in_place_scope_fifo" class="fn">in_place_scope_fifo</a>&lt;'scope, OP, R&gt;(&amp;self, op: OP) -&gt; R<div class="where">where
OP: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;<a class="struct" href="struct.ScopeFifo.html" title="struct rayon::ScopeFifo">ScopeFifo</a>&lt;'scope&gt;) -&gt; R,</div></h4></section></summary><div class="docblock"><p>Creates a scope that spawns work into this thread pool in FIFO order.</p>
<p>See also: <a href="fn.in_place_scope_fifo.html" title="fn rayon::in_place_scope_fifo">the <code>in_place_scope_fifo()</code> function</a>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.spawn" class="method"><a class="src rightside" href="../src/rayon_core/thread_pool/mod.rs.html#338-340">Source</a><h4 class="code-header">pub fn <a href="#method.spawn" class="fn">spawn</a>&lt;OP&gt;(&amp;self, op: OP)<div class="where">where
OP: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>() + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'static,</div></h4></section></summary><div class="docblock"><p>Spawns an asynchronous task in this thread pool. This task will
run in the implicit, global scope, which means that it may outlast
the current stack frame therefore, it cannot capture any references
onto the stack (you will likely need a <code>move</code> closure).</p>
<p>See also: <a href="struct.Scope.html#method.spawn" title="method rayon::Scope::spawn">the <code>spawn()</code> function defined on scopes</a>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.spawn_fifo" class="method"><a class="src rightside" href="../src/rayon_core/thread_pool/mod.rs.html#354-356">Source</a><h4 class="code-header">pub fn <a href="#method.spawn_fifo" class="fn">spawn_fifo</a>&lt;OP&gt;(&amp;self, op: OP)<div class="where">where
OP: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>() + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'static,</div></h4></section></summary><div class="docblock"><p>Spawns an asynchronous task in this thread pool. This task will
run in the implicit, global scope, which means that it may outlast
the current stack frame therefore, it cannot capture any references
onto the stack (you will likely need a <code>move</code> closure).</p>
<p>See also: <a href="struct.ScopeFifo.html#method.spawn_fifo" title="method rayon::ScopeFifo::spawn_fifo">the <code>spawn_fifo()</code> function defined on scopes</a>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.spawn_broadcast" class="method"><a class="src rightside" href="../src/rayon_core/thread_pool/mod.rs.html#366-368">Source</a><h4 class="code-header">pub fn <a href="#method.spawn_broadcast" class="fn">spawn_broadcast</a>&lt;OP&gt;(&amp;self, op: OP)<div class="where">where
OP: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(<a class="struct" href="struct.BroadcastContext.html" title="struct rayon::BroadcastContext">BroadcastContext</a>&lt;'_&gt;) + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'static,</div></h4></section></summary><div class="docblock"><p>Spawns an asynchronous task on every thread in this thread pool. This task
will run in the implicit, global scope, which means that it may outlast the
current stack frame therefore, it cannot capture any references onto the
stack (you will likely need a <code>move</code> closure).</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.yield_now" class="method"><a class="src rightside" href="../src/rayon_core/thread_pool/mod.rs.html#381">Source</a><h4 class="code-header">pub fn <a href="#method.yield_now" class="fn">yield_now</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="enum.Yield.html" title="enum rayon::Yield">Yield</a>&gt;</h4></section></summary><div class="docblock"><p>Cooperatively yields execution to Rayon.</p>
<p>This is similar to the general <a href="fn.yield_now.html" title="fn rayon::yield_now"><code>yield_now()</code></a>, but only if the current
thread is part of <em>this</em> thread pool.</p>
<p>Returns <code>Some(Yield::Executed)</code> if anything was executed, <code>Some(Yield::Idle)</code> if
nothing was available, or <code>None</code> if the current thread is not part this pool.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.yield_local" class="method"><a class="src rightside" href="../src/rayon_core/thread_pool/mod.rs.html#393">Source</a><h4 class="code-header">pub fn <a href="#method.yield_local" class="fn">yield_local</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="enum.Yield.html" title="enum rayon::Yield">Yield</a>&gt;</h4></section></summary><div class="docblock"><p>Cooperatively yields execution to local Rayon work.</p>
<p>This is similar to the general <a href="fn.yield_local.html" title="fn rayon::yield_local"><code>yield_local()</code></a>, but only if the current
thread is part of <em>this</em> thread pool.</p>
<p>Returns <code>Some(Yield::Executed)</code> if anything was executed, <code>Some(Yield::Idle)</code> if
nothing was available, or <code>None</code> if the current thread is not part this pool.</p>
</div></details></div></details></div><h2 id="trait-implementations" class="section-header">Trait Implementations<a href="#trait-implementations" class="anchor">§</a></h2><div id="trait-implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-Debug-for-ThreadPool" class="impl"><a class="src rightside" href="../src/rayon_core/thread_pool/mod.rs.html#405">Source</a><a href="#impl-Debug-for-ThreadPool" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="struct.ThreadPool.html" title="struct rayon::ThreadPool">ThreadPool</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl"><a class="src rightside" href="../src/rayon_core/thread_pool/mod.rs.html#406">Source</a><a href="#method.fmt" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/fmt/trait.Debug.html#tymethod.fmt" class="fn">fmt</a>(&amp;self, fmt: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/fmt/struct.Error.html" title="struct core::fmt::Error">Error</a>&gt;</h4></section></summary><div class='docblock'>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/1.93.1/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Drop-for-ThreadPool" class="impl"><a class="src rightside" href="../src/rayon_core/thread_pool/mod.rs.html#399">Source</a><a href="#impl-Drop-for-ThreadPool" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/drop/trait.Drop.html" title="trait core::ops::drop::Drop">Drop</a> for <a class="struct" href="struct.ThreadPool.html" title="struct rayon::ThreadPool">ThreadPool</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.drop" class="method trait-impl"><a class="src rightside" href="../src/rayon_core/thread_pool/mod.rs.html#400">Source</a><a href="#method.drop" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/ops/drop/trait.Drop.html#tymethod.drop" class="fn">drop</a>(&amp;mut self)</h4></section></summary><div class='docblock'>Executes the destructor for this type. <a href="https://doc.rust-lang.org/1.93.1/core/ops/drop/trait.Drop.html#tymethod.drop">Read more</a></div></details></div></details></div><h2 id="synthetic-implementations" class="section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor">§</a></h2><div id="synthetic-implementations-list"><section id="impl-Freeze-for-ThreadPool" class="impl"><a href="#impl-Freeze-for-ThreadPool" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Freeze.html" title="trait core::marker::Freeze">Freeze</a> for <a class="struct" href="struct.ThreadPool.html" title="struct rayon::ThreadPool">ThreadPool</a></h3></section><section id="impl-RefUnwindSafe-for-ThreadPool" class="impl"><a href="#impl-RefUnwindSafe-for-ThreadPool" class="anchor">§</a><h3 class="code-header">impl !<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.ThreadPool.html" title="struct rayon::ThreadPool">ThreadPool</a></h3></section><section id="impl-Send-for-ThreadPool" class="impl"><a href="#impl-Send-for-ThreadPool" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.ThreadPool.html" title="struct rayon::ThreadPool">ThreadPool</a></h3></section><section id="impl-Sync-for-ThreadPool" class="impl"><a href="#impl-Sync-for-ThreadPool" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.ThreadPool.html" title="struct rayon::ThreadPool">ThreadPool</a></h3></section><section id="impl-Unpin-for-ThreadPool" class="impl"><a href="#impl-Unpin-for-ThreadPool" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.ThreadPool.html" title="struct rayon::ThreadPool">ThreadPool</a></h3></section><section id="impl-UnwindSafe-for-ThreadPool" class="impl"><a href="#impl-UnwindSafe-for-ThreadPool" class="anchor">§</a><h3 class="code-header">impl !<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.ThreadPool.html" title="struct rayon::ThreadPool">ThreadPool</a></h3></section></div><h2 id="blanket-implementations" class="section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor">§</a></h2><div id="blanket-implementations-list"><details class="toggle implementors-toggle"><summary><section id="impl-Any-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/any.rs.html#138">Source</a><a href="#impl-Any-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T<div class="where">where
T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/any.rs.html#139">Source</a><a href="#method.type_id" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/any/trait.Any.html#tymethod.type_id" class="fn">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></section></summary><div class='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.93.1/core/any/trait.Any.html#tymethod.type_id">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/borrow.rs.html#212">Source</a><a href="#impl-Borrow%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T<div class="where">where
T: ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/borrow.rs.html#214">Source</a><a href="#method.borrow" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/borrow/trait.Borrow.html#tymethod.borrow" class="fn">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;T</a></h4></section></summary><div class='docblock'>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.93.1/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/borrow.rs.html#221">Source</a><a href="#impl-BorrowMut%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T<div class="where">where
T: ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/borrow.rs.html#222">Source</a><a href="#method.borrow_mut" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fn">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;mut T</a></h4></section></summary><div class='docblock'>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.93.1/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-From%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/convert/mod.rs.html#785">Source</a><a href="#impl-From%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/convert/mod.rs.html#788">Source</a><a href="#method.from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(t: T) -&gt; T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/convert/mod.rs.html#767-769">Source</a><a href="#impl-Into%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T<div class="where">where
U: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/convert/mod.rs.html#777">Source</a><a href="#method.into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.Into.html#tymethod.into" class="fn">into</a>(self) -&gt; U</h4></section></summary><div class="docblock"><p>Calls <code>U::from(self)</code>.</p>
<p>That is, this conversion is whatever the implementation of
<code><a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for U</code> chooses to do.</p>
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-IntoEither-for-T" class="impl"><a class="src rightside" href="../src/either/into_either.rs.html#64">Source</a><a href="#impl-IntoEither-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="../either/into_either/trait.IntoEither.html" title="trait either::into_either::IntoEither">IntoEither</a> for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.into_either" class="method trait-impl"><a class="src rightside" href="../src/either/into_either.rs.html#29">Source</a><a href="#method.into_either" class="anchor">§</a><h4 class="code-header">fn <a href="../either/into_either/trait.IntoEither.html#method.into_either" class="fn">into_either</a>(self, into_left: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.bool.html">bool</a>) -&gt; <a class="enum" href="iter/enum.Either.html" title="enum rayon::iter::Either">Either</a>&lt;Self, Self&gt; <a href="#" class="tooltip" data-notable-ty="Either&lt;Self, Self&gt;"></a></h4></section></summary><div class='docblock'>Converts <code>self</code> into a <a href="iter/enum.Either.html#variant.Left" title="variant rayon::iter::Either::Left"><code>Left</code></a> variant of <a href="iter/enum.Either.html" title="enum rayon::iter::Either"><code>Either&lt;Self, Self&gt;</code></a>
if <code>into_left</code> is <code>true</code>.
Converts <code>self</code> into a <a href="iter/enum.Either.html#variant.Right" title="variant rayon::iter::Either::Right"><code>Right</code></a> variant of <a href="iter/enum.Either.html" title="enum rayon::iter::Either"><code>Either&lt;Self, Self&gt;</code></a>
otherwise. <a href="../either/into_either/trait.IntoEither.html#method.into_either">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.into_either_with" class="method trait-impl"><a class="src rightside" href="../src/either/into_either.rs.html#55-57">Source</a><a href="#method.into_either_with" class="anchor">§</a><h4 class="code-header">fn <a href="../either/into_either/trait.IntoEither.html#method.into_either_with" class="fn">into_either_with</a>&lt;F&gt;(self, into_left: F) -&gt; <a class="enum" href="iter/enum.Either.html" title="enum rayon::iter::Either">Either</a>&lt;Self, Self&gt; <a href="#" class="tooltip" data-notable-ty="Either&lt;Self, Self&gt;"></a><div class="where">where
F: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;Self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.bool.html">bool</a>,</div></h4></section></summary><div class='docblock'>Converts <code>self</code> into a <a href="iter/enum.Either.html#variant.Left" title="variant rayon::iter::Either::Left"><code>Left</code></a> variant of <a href="iter/enum.Either.html" title="enum rayon::iter::Either"><code>Either&lt;Self, Self&gt;</code></a>
if <code>into_left(&amp;self)</code> returns <code>true</code>.
Converts <code>self</code> into a <a href="iter/enum.Either.html#variant.Right" title="variant rayon::iter::Either::Right"><code>Right</code></a> variant of <a href="iter/enum.Either.html" title="enum rayon::iter::Either"><code>Either&lt;Self, Self&gt;</code></a>
otherwise. <a href="../either/into_either/trait.IntoEither.html#method.into_either_with">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Pointable-for-T" class="impl"><a class="src rightside" href="../src/crossbeam_epoch/atomic.rs.html#194">Source</a><a href="#impl-Pointable-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="../crossbeam_epoch/atomic/trait.Pointable.html" title="trait crossbeam_epoch::atomic::Pointable">Pointable</a> for T</h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedconstant.ALIGN" class="associatedconstant trait-impl"><a class="src rightside" href="../src/crossbeam_epoch/atomic.rs.html#195">Source</a><a href="#associatedconstant.ALIGN" class="anchor">§</a><h4 class="code-header">const <a href="../crossbeam_epoch/atomic/trait.Pointable.html#associatedconstant.ALIGN" class="constant">ALIGN</a>: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a></h4></section></summary><div class='docblock'>The alignment of pointer.</div></details><details class="toggle" open><summary><section id="associatedtype.Init" class="associatedtype trait-impl"><a class="src rightside" href="../src/crossbeam_epoch/atomic.rs.html#197">Source</a><a href="#associatedtype.Init" class="anchor">§</a><h4 class="code-header">type <a href="../crossbeam_epoch/atomic/trait.Pointable.html#associatedtype.Init" class="associatedtype">Init</a> = T</h4></section></summary><div class='docblock'>The type for initializers.</div></details><details class="toggle method-toggle" open><summary><section id="method.init" class="method trait-impl"><a class="src rightside" href="../src/crossbeam_epoch/atomic.rs.html#199">Source</a><a href="#method.init" class="anchor">§</a><h4 class="code-header">unsafe fn <a href="../crossbeam_epoch/atomic/trait.Pointable.html#tymethod.init" class="fn">init</a>(init: &lt;T as <a class="trait" href="../crossbeam_epoch/atomic/trait.Pointable.html" title="trait crossbeam_epoch::atomic::Pointable">Pointable</a>&gt;::<a class="associatedtype" href="../crossbeam_epoch/atomic/trait.Pointable.html#associatedtype.Init" title="type crossbeam_epoch::atomic::Pointable::Init">Init</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a></h4></section></summary><div class='docblock'>Initializes a with the given initializer. <a href="../crossbeam_epoch/atomic/trait.Pointable.html#tymethod.init">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.deref" class="method trait-impl"><a class="src rightside" href="../src/crossbeam_epoch/atomic.rs.html#203">Source</a><a href="#method.deref" class="anchor">§</a><h4 class="code-header">unsafe fn <a href="../crossbeam_epoch/atomic/trait.Pointable.html#tymethod.deref" class="fn">deref</a>&lt;'a&gt;(ptr: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;'a T</a></h4></section></summary><div class='docblock'>Dereferences the given pointer. <a href="../crossbeam_epoch/atomic/trait.Pointable.html#tymethod.deref">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.deref_mut" class="method trait-impl"><a class="src rightside" href="../src/crossbeam_epoch/atomic.rs.html#207">Source</a><a href="#method.deref_mut" class="anchor">§</a><h4 class="code-header">unsafe fn <a href="../crossbeam_epoch/atomic/trait.Pointable.html#tymethod.deref_mut" class="fn">deref_mut</a>&lt;'a&gt;(ptr: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;'a mut T</a></h4></section></summary><div class='docblock'>Mutably dereferences the given pointer. <a href="../crossbeam_epoch/atomic/trait.Pointable.html#tymethod.deref_mut">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.drop-1" class="method trait-impl"><a class="src rightside" href="../src/crossbeam_epoch/atomic.rs.html#211">Source</a><a href="#method.drop-1" class="anchor">§</a><h4 class="code-header">unsafe fn <a href="../crossbeam_epoch/atomic/trait.Pointable.html#tymethod.drop" class="fn">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>)</h4></section></summary><div class='docblock'>Drops the object pointed to by the given pointer. <a href="../crossbeam_epoch/atomic/trait.Pointable.html#tymethod.drop">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/convert/mod.rs.html#827-829">Source</a><a href="#impl-TryFrom%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T<div class="where">where
U: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-1" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/convert/mod.rs.html#831">Source</a><a href="#associatedtype.Error-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/convert/mod.rs.html#834">Source</a><a href="#method.try_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/convert/mod.rs.html#811-813">Source</a><a href="#impl-TryInto%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T<div class="where">where
U: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/convert/mod.rs.html#815">Source</a><a href="#associatedtype.Error" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/convert/mod.rs.html#818">Source</a><a href="#method.try_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryInto.html#tymethod.try_into" class="fn">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details></div><script type="text/json" id="notable-traits-data">{"Either<Self, Self>":"<h3>Notable traits for <code><a class=\"enum\" href=\"iter/enum.Either.html\" title=\"enum rayon::iter::Either\">Either</a>&lt;L, R&gt;</code></h3><pre><code><div class=\"where\">impl&lt;L, R&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.93.1/core/iter/traits/iterator/trait.Iterator.html\" title=\"trait core::iter::traits::iterator::Iterator\">Iterator</a> for <a class=\"enum\" href=\"iter/enum.Either.html\" title=\"enum rayon::iter::Either\">Either</a>&lt;L, R&gt;<div class=\"where\">where\n L: <a class=\"trait\" href=\"https://doc.rust-lang.org/1.93.1/core/iter/traits/iterator/trait.Iterator.html\" title=\"trait core::iter::traits::iterator::Iterator\">Iterator</a>,\n R: <a class=\"trait\" href=\"https://doc.rust-lang.org/1.93.1/core/iter/traits/iterator/trait.Iterator.html\" title=\"trait core::iter::traits::iterator::Iterator\">Iterator</a>&lt;Item = &lt;L as <a class=\"trait\" href=\"https://doc.rust-lang.org/1.93.1/core/iter/traits/iterator/trait.Iterator.html\" title=\"trait core::iter::traits::iterator::Iterator\">Iterator</a>&gt;::<a class=\"associatedtype\" href=\"https://doc.rust-lang.org/1.93.1/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\" title=\"type core::iter::traits::iterator::Iterator::Item\">Item</a>&gt;,</div></div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/1.93.1/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\" class=\"associatedtype\">Item</a> = &lt;L as <a class=\"trait\" href=\"https://doc.rust-lang.org/1.93.1/core/iter/traits/iterator/trait.Iterator.html\" title=\"trait core::iter::traits::iterator::Iterator\">Iterator</a>&gt;::<a class=\"associatedtype\" href=\"https://doc.rust-lang.org/1.93.1/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\" title=\"type core::iter::traits::iterator::Iterator::Item\">Item</a>;</div><div class=\"where\">impl&lt;L, R&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html\" title=\"trait core::future::future::Future\">Future</a> for <a class=\"enum\" href=\"iter/enum.Either.html\" title=\"enum rayon::iter::Either\">Either</a>&lt;L, R&gt;<div class=\"where\">where\n L: <a class=\"trait\" href=\"https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html\" title=\"trait core::future::future::Future\">Future</a>,\n R: <a class=\"trait\" href=\"https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html\" title=\"trait core::future::future::Future\">Future</a>&lt;Output = &lt;L as <a class=\"trait\" href=\"https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html\" title=\"trait core::future::future::Future\">Future</a>&gt;::<a class=\"associatedtype\" href=\"https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html#associatedtype.Output\" title=\"type core::future::future::Future::Output\">Output</a>&gt;,</div></div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html#associatedtype.Output\" class=\"associatedtype\">Output</a> = &lt;L as <a class=\"trait\" href=\"https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html\" title=\"trait core::future::future::Future\">Future</a>&gt;::<a class=\"associatedtype\" href=\"https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html#associatedtype.Output\" title=\"type core::future::future::Future::Output\">Output</a>;</div><div class=\"where\">impl&lt;L, R&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.93.1/std/io/trait.Read.html\" title=\"trait std::io::Read\">Read</a> for <a class=\"enum\" href=\"iter/enum.Either.html\" title=\"enum rayon::iter::Either\">Either</a>&lt;L, R&gt;<div class=\"where\">where\n L: <a class=\"trait\" href=\"https://doc.rust-lang.org/1.93.1/std/io/trait.Read.html\" title=\"trait std::io::Read\">Read</a>,\n R: <a class=\"trait\" href=\"https://doc.rust-lang.org/1.93.1/std/io/trait.Read.html\" title=\"trait std::io::Read\">Read</a>,</div></div><div class=\"where\">impl&lt;L, R&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.93.1/std/io/trait.Write.html\" title=\"trait std::io::Write\">Write</a> for <a class=\"enum\" href=\"iter/enum.Either.html\" title=\"enum rayon::iter::Either\">Either</a>&lt;L, R&gt;<div class=\"where\">where\n L: <a class=\"trait\" href=\"https://doc.rust-lang.org/1.93.1/std/io/trait.Write.html\" title=\"trait std::io::Write\">Write</a>,\n R: <a class=\"trait\" href=\"https://doc.rust-lang.org/1.93.1/std/io/trait.Write.html\" title=\"trait std::io::Write\">Write</a>,</div></div>"}</script></section></div></main></body></html>