Adding large folders

This commit is contained in:
2026-02-26 12:00:21 -05:00
parent 5400d82acd
commit 49701c85ad
47332 changed files with 1942573 additions and 0 deletions

View File

@@ -0,0 +1 @@
<!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="List of all items in this crate"><title>List of all items in this crate</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_core" 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="../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 mod sys"><!--[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="#">All</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../rayon_core/index.html">rayon_<wbr>core</a><span class="version">1.13.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h3><a href="#structs">Crate Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"></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"><h1>List of all items</h1><rustdoc-toolbar></rustdoc-toolbar></div><h3 id="structs">Structs</h3><ul class="all-items"><li><a href="struct.BroadcastContext.html">BroadcastContext</a></li><li><a href="struct.Configuration.html">Configuration</a></li><li><a href="struct.FnContext.html">FnContext</a></li><li><a href="struct.Scope.html">Scope</a></li><li><a href="struct.ScopeFifo.html">ScopeFifo</a></li><li><a href="struct.ThreadBuilder.html">ThreadBuilder</a></li><li><a href="struct.ThreadPool.html">ThreadPool</a></li><li><a href="struct.ThreadPoolBuildError.html">ThreadPoolBuildError</a></li><li><a href="struct.ThreadPoolBuilder.html">ThreadPoolBuilder</a></li></ul><h3 id="enums">Enums</h3><ul class="all-items"><li><a href="enum.Yield.html">Yield</a></li></ul><h3 id="functions">Functions</h3><ul class="all-items"><li><a href="fn.broadcast.html">broadcast</a></li><li><a href="fn.current_num_threads.html">current_num_threads</a></li><li><a href="fn.current_thread_has_pending_tasks.html">current_thread_has_pending_tasks</a></li><li><a href="fn.current_thread_index.html">current_thread_index</a></li><li><a href="fn.in_place_scope.html">in_place_scope</a></li><li><a href="fn.in_place_scope_fifo.html">in_place_scope_fifo</a></li><li><a href="fn.initialize.html">initialize</a></li><li><a href="fn.join.html">join</a></li><li><a href="fn.join_context.html">join_context</a></li><li><a href="fn.max_num_threads.html">max_num_threads</a></li><li><a href="fn.scope.html">scope</a></li><li><a href="fn.scope_fifo.html">scope_fifo</a></li><li><a href="fn.spawn.html">spawn</a></li><li><a href="fn.spawn_broadcast.html">spawn_broadcast</a></li><li><a href="fn.spawn_fifo.html">spawn_fifo</a></li><li><a href="fn.yield_local.html">yield_local</a></li><li><a href="fn.yield_now.html">yield_now</a></li></ul></section></div></main></body></html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../rayon_core/fn.broadcast.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../rayon_core/fn.broadcast.html">../../rayon_core/fn.broadcast.html</a>...</p>
<script>location.replace("../../rayon_core/fn.broadcast.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../rayon_core/fn.spawn_broadcast.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../rayon_core/fn.spawn_broadcast.html">../../rayon_core/fn.spawn_broadcast.html</a>...</p>
<script>location.replace("../../rayon_core/fn.spawn_broadcast.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../rayon_core/struct.BroadcastContext.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../rayon_core/struct.BroadcastContext.html">../../rayon_core/struct.BroadcastContext.html</a>...</p>
<script>location.replace("../../rayon_core/struct.BroadcastContext.html" + location.search + location.hash);</script>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,9 @@
<!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="Executes `op` within every thread in the current thread pool. If this is called from a non-Rayon thread, it will execute in the global thread pool. Any attempts to use `join`, `scope`, or parallel iterators will then operate within that thread pool. When the call has completed on each thread, returns a vector containing all of their return values."><title>broadcast in rayon_core - 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_core" 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 fn"><!--[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="#">broadcast</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../rayon_core/index.html">rayon_<wbr>core</a><span class="version">1.13.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"></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_core</a></div><h1>Function <span class="fn">broadcast</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/broadcast/mod.rs.html#19-26">Source</a> </span></div><pre class="rust item-decl"><code>pub fn broadcast&lt;OP, R&gt;(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_core::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></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Executes <code>op</code> within every thread in the current thread pool. If this is
called from a non-Rayon thread, it will execute in the global thread pool.
Any attempts to use <code>join</code>, <code>scope</code>, or parallel iterators will then operate
within that thread pool. When the call has completed on each thread, returns
a vector containing all of their return values.</p>
<p>For more information, see the <a href="struct.ThreadPool.html#method.broadcast" title="method rayon_core::ThreadPool::broadcast"><code>ThreadPool::broadcast()</code></a> method.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,14 @@
<!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="Returns the number of threads in the current registry. If this code is executing within a Rayon thread pool, then this will be the number of threads for the thread pool of the current thread. Otherwise, it will be the number of threads for the global thread pool."><title>current_num_threads in rayon_core - 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_core" 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 fn"><!--[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="#">current_num_threads</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../rayon_core/index.html">rayon_<wbr>core</a><span class="version">1.13.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">current_<wbr>num_<wbr>threads</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#future-compatibility-note" title="Future compatibility note">Future compatibility note</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate rayon_<wbr>core</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_core</a></div><h1>Function <span class="fn">current_<wbr>num_<wbr>threads</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/lib.rs.html#136-138">Source</a> </span></div><pre class="rust item-decl"><code>pub fn current_num_threads() -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Returns the number of threads in the current registry. If this
code is executing within a Rayon thread pool, then this will be
the number of threads for the thread pool of the current
thread. Otherwise, it will be the number of threads for the global
thread pool.</p>
<p>This can be useful when trying to judge how many times to split
parallel work (the parallel iterator traits use this value
internally for this purpose).</p>
<h2 id="future-compatibility-note"><a class="doc-anchor" href="#future-compatibility-note">§</a>Future compatibility note</h2>
<p>Note that unless this thread pool was created with a
builder 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_core::ThreadPoolBuilder::num_threads">the
<code>num_threads()</code> method for details</a>).</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,5 @@
<!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="If called from a Rayon worker thread, indicates whether that threads local deque still has pending tasks. Otherwise, returns `None`. For more information, see the `ThreadPool::current_thread_has_pending_tasks()` method."><title>current_thread_has_pending_tasks in rayon_core - 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_core" 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 fn"><!--[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="#">current_thread_has_pending_tasks</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../rayon_core/index.html">rayon_<wbr>core</a><span class="version">1.13.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"></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_core</a></div><h1>Function <span class="fn">current_<wbr>thread_<wbr>has_<wbr>pending_<wbr>tasks</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#452-457">Source</a> </span></div><pre class="rust item-decl"><code>pub fn current_thread_has_pending_tasks() -&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;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>If called from a Rayon worker thread, indicates whether that
threads local deque still has pending tasks. Otherwise, returns
<code>None</code>. For more information, see <a href="struct.ThreadPool.html#method.current_thread_has_pending_tasks" title="method rayon_core::ThreadPool::current_thread_has_pending_tasks">the
<code>ThreadPool::current_thread_has_pending_tasks()</code> method</a>.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,16 @@
<!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="If called from a Rayon worker thread, returns the index of that thread within its current pool; if not called from a Rayon thread, returns `None`."><title>current_thread_index in rayon_core - 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_core" 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 fn"><!--[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="#">current_thread_index</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../rayon_core/index.html">rayon_<wbr>core</a><span class="version">1.13.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">current_<wbr>thread_<wbr>index</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#future-compatibility-note" title="Future compatibility note">Future compatibility note</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate rayon_<wbr>core</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_core</a></div><h1>Function <span class="fn">current_<wbr>thread_<wbr>index</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#438-443">Source</a> </span></div><pre class="rust item-decl"><code>pub fn current_thread_index() -&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;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>If called from a Rayon worker thread, returns the index of that
thread within its current pool; if not called from a Rayon thread,
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>
<p>See also: <a href="struct.ThreadPool.html#method.current_thread_index" title="method rayon_core::ThreadPool::current_thread_index">the <code>ThreadPool::current_thread_index()</code> method</a>.</p>
<h2 id="future-compatibility-note"><a class="doc-anchor" href="#future-compatibility-note">§</a>Future compatibility note</h2>
<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_core::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></section></div></main></body></html>

View File

@@ -0,0 +1,20 @@
<!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="Creates a “fork-join” scope `s` and invokes the closure with a reference to `s`. This closure can then spawn asynchronous tasks into `s`. Those tasks may run asynchronously with respect to the closure; they may themselves spawn additional tasks into `s`. When the closure returns, it will block until all tasks that have been spawned into `s` complete."><title>in_place_scope in rayon_core - 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_core" 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 fn"><!--[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="#">in_place_scope</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../rayon_core/index.html">rayon_<wbr>core</a><span class="version">1.13.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">in_<wbr>place_<wbr>scope</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#panics" title="Panics">Panics</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate rayon_<wbr>core</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_core</a></div><h1>Function <span class="fn">in_<wbr>place_<wbr>scope</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/scope/mod.rs.html#398-403">Source</a> </span></div><pre class="rust item-decl"><code>pub fn in_place_scope&lt;'scope, OP, R&gt;(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_core::Scope">Scope</a>&lt;'scope&gt;) -&gt; R,</div></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Creates a “fork-join” scope <code>s</code> and invokes the closure with a
reference to <code>s</code>. This closure can then spawn asynchronous tasks
into <code>s</code>. Those tasks may run asynchronously with respect to the
closure; they may themselves spawn additional tasks into <code>s</code>. When
the closure returns, it will block until all tasks that have been
spawned into <code>s</code> complete.</p>
<p>This is just like <code>scope()</code> except the closure runs on the same thread
that calls <code>in_place_scope()</code>. Only work that it spawns runs in the
thread pool.</p>
<h2 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h2>
<p>If a panic occurs, either in the closure given to <code>in_place_scope()</code> or in
any of the spawned jobs, that panic will be propagated and the
call to <code>in_place_scope()</code> will panic. If multiple panics occurs, it is
non-deterministic which of their panic values will propagate.
Regardless, once a task is spawned using <code>scope.spawn()</code>, it will
execute, even if the spawning task should later panic. <code>in_place_scope()</code>
returns once all spawned jobs have completed, and any panics are
propagated at that point.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,20 @@
<!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="Creates a “fork-join” scope `s` with FIFO order, and invokes the closure with a reference to `s`. This closure can then spawn asynchronous tasks into `s`. Those tasks may run asynchronously with respect to the closure; they may themselves spawn additional tasks into `s`. When the closure returns, it will block until all tasks that have been spawned into `s` complete."><title>in_place_scope_fifo in rayon_core - 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_core" 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 fn"><!--[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="#">in_place_scope_fifo</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../rayon_core/index.html">rayon_<wbr>core</a><span class="version">1.13.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">in_<wbr>place_<wbr>scope_<wbr>fifo</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#panics" title="Panics">Panics</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate rayon_<wbr>core</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_core</a></div><h1>Function <span class="fn">in_<wbr>place_<wbr>scope_<wbr>fifo</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/scope/mod.rs.html#449-454">Source</a> </span></div><pre class="rust item-decl"><code>pub fn in_place_scope_fifo&lt;'scope, OP, R&gt;(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_core::ScopeFifo">ScopeFifo</a>&lt;'scope&gt;) -&gt; R,</div></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Creates a “fork-join” scope <code>s</code> with FIFO order, and invokes the
closure with a reference to <code>s</code>. This closure can then spawn
asynchronous tasks into <code>s</code>. Those tasks may run asynchronously with
respect to the closure; they may themselves spawn additional tasks
into <code>s</code>. When the closure returns, it will block until all tasks
that have been spawned into <code>s</code> complete.</p>
<p>This is just like <code>scope_fifo()</code> except the closure runs on the same thread
that calls <code>in_place_scope_fifo()</code>. Only work that it spawns runs in the
thread pool.</p>
<h2 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h2>
<p>If a panic occurs, either in the closure given to <code>in_place_scope_fifo()</code> or in
any of the spawned jobs, that panic will be propagated and the
call to <code>in_place_scope_fifo()</code> will panic. If multiple panics occurs, it is
non-deterministic which of their panic values will propagate.
Regardless, once a task is spawned using <code>scope.spawn_fifo()</code>, it will
execute, even if the spawning task should later panic. <code>in_place_scope_fifo()</code>
returns once all spawned jobs have completed, and any panics are
propagated at that point.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,2 @@
<!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="Deprecated in favor of `ThreadPoolBuilder::build_global`."><title>initialize in rayon_core - 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_core" 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 fn"><!--[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="#">initialize</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../rayon_core/index.html">rayon_<wbr>core</a><span class="version">1.13.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"></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_core</a></div><h1>Function <span class="fn">initialize</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/lib.rs.html#787-789">Source</a> </span></div><pre class="rust item-decl"><code>pub fn initialize(config: <a class="struct" href="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="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/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;</code></pre><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated: use <code>ThreadPoolBuilder::build_global</code></span></div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Deprecated in favor of <code>ThreadPoolBuilder::build_global</code>.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,72 @@
<!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="Takes two closures and potentially runs them in parallel. It returns a pair of the results from those closures."><title>join in rayon_core - 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_core" 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 fn"><!--[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="#">join</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../rayon_core/index.html">rayon_<wbr>core</a><span class="version">1.13.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">join</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#examples" title="Examples">Examples</a></li><li><a href="#warning-about-blocking-io" title="Warning about blocking I/O">Warning about blocking I/O</a></li><li><a href="#panics" title="Panics">Panics</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate rayon_<wbr>core</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_core</a></div><h1>Function <span class="fn">join</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/join/mod.rs.html#93-106">Source</a> </span></div><pre class="rust item-decl"><code>pub fn join&lt;A, B, RA, RB&gt;(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></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Takes two closures and <em>potentially</em> runs them in parallel. It
returns a pair of the results from those closures.</p>
<p>Conceptually, calling <code>join()</code> is similar to spawning two threads,
one executing each of the two closures. However, the
implementation is quite different and incurs very low
overhead. The underlying technique is called “work stealing”: the
Rayon runtime uses a fixed pool of worker threads and attempts to
only execute code in parallel when there are idle CPUs to handle
it.</p>
<p>When <code>join</code> is called from outside the thread pool, the calling
thread will block while the closures execute in the pool. When
<code>join</code> is called within the pool, the calling thread still actively
participates in the thread pool. It will begin by executing closure
A (on the current thread). While it is doing that, it will advertise
closure B as being available for other threads to execute. Once closure A
has completed, the current thread will try to execute closure B;
if however closure B has been stolen, then it will look for other work
while waiting for the thief to fully execute closure B. (This is the
typical work-stealing strategy).</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<p>This example uses join to perform a quick-sort (note this is not a
particularly optimized implementation: if you <strong>actually</strong> want to
sort for real, you should prefer <a href="../rayon/slice/trait.ParallelSliceMut.html#method.par_sort">the <code>par_sort</code> method</a> offered
by Rayon).</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span><span class="kw-2">mut </span>v = <span class="macro">vec!</span>[<span class="number">5</span>, <span class="number">1</span>, <span class="number">8</span>, <span class="number">22</span>, <span class="number">0</span>, <span class="number">44</span>];
quick_sort(<span class="kw-2">&amp;mut </span>v);
<span class="macro">assert_eq!</span>(v, <span class="macro">vec!</span>[<span class="number">0</span>, <span class="number">1</span>, <span class="number">5</span>, <span class="number">8</span>, <span class="number">22</span>, <span class="number">44</span>]);
<span class="kw">fn </span>quick_sort&lt;T:PartialOrd+Send&gt;(v: <span class="kw-2">&amp;mut </span>[T]) {
<span class="kw">if </span>v.len() &gt; <span class="number">1 </span>{
<span class="kw">let </span>mid = partition(v);
<span class="kw">let </span>(lo, hi) = v.split_at_mut(mid);
rayon::join(|| quick_sort(lo),
|| quick_sort(hi));
}
}
<span class="comment">// Partition rearranges all items `&lt;=` to the pivot
// item (arbitrary selected to be the last item in the slice)
// to the first half of the slice. It then returns the
// "dividing point" where the pivot is placed.
</span><span class="kw">fn </span>partition&lt;T:PartialOrd+Send&gt;(v: <span class="kw-2">&amp;mut </span>[T]) -&gt; usize {
<span class="kw">let </span>pivot = v.len() - <span class="number">1</span>;
<span class="kw">let </span><span class="kw-2">mut </span>i = <span class="number">0</span>;
<span class="kw">for </span>j <span class="kw">in </span><span class="number">0</span>..pivot {
<span class="kw">if </span>v[j] &lt;= v[pivot] {
v.swap(i, j);
i += <span class="number">1</span>;
}
}
v.swap(i, pivot);
i
}</code></pre></div><h2 id="warning-about-blocking-io"><a class="doc-anchor" href="#warning-about-blocking-io">§</a>Warning about blocking I/O</h2>
<p>The assumption is that the closures given to <code>join()</code> are
CPU-bound tasks that do not perform I/O or other blocking
operations. If you do perform I/O, and that I/O should block
(e.g., waiting for a network request), the overall performance may
be poor. Moreover, if you cause one closure to be blocked waiting
on another (for example, using a channel), that could lead to a
deadlock.</p>
<h2 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h2>
<p>No matter what happens, both closures will always be executed. If
a single closure panics, whether it be the first or second
closure, that panic will be propagated and hence <code>join()</code> will
panic with the same panic value. If both closures panic, <code>join()</code>
will panic with the panic value from the first closure.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,12 @@
<!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="Identical to `join`, except that the closures have a parameter that provides context for the way the closure has been called, especially indicating whether theyre executing on a different thread than where `join_context` was called. This will occur if the second job is stolen by a different thread, or if `join_context` was called from outside the thread pool to begin with."><title>join_context in rayon_core - 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_core" 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 fn"><!--[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="#">join_context</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../rayon_core/index.html">rayon_<wbr>core</a><span class="version">1.13.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"></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_core</a></div><h1>Function <span class="fn">join_<wbr>context</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/join/mod.rs.html#115-173">Source</a> </span></div><pre class="rust item-decl"><code>pub fn join_context&lt;A, B, RA, RB&gt;(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>(<a class="struct" href="struct.FnContext.html" title="struct rayon_core::FnContext">FnContext</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>(<a class="struct" href="struct.FnContext.html" title="struct rayon_core::FnContext">FnContext</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></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Identical to <code>join</code>, except that the closures have a parameter
that provides context for the way the closure has been called,
especially indicating whether theyre executing on a different
thread than where <code>join_context</code> was called. This will occur if
the second job is stolen by a different thread, or if
<code>join_context</code> was called from outside the thread pool to begin
with.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,5 @@
<!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="Returns the maximum number of threads that Rayon supports in a single thread pool."><title>max_num_threads in rayon_core - 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_core" 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 fn"><!--[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="#">max_num_threads</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../rayon_core/index.html">rayon_<wbr>core</a><span class="version">1.13.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"></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_core</a></div><h1>Function <span class="fn">max_<wbr>num_<wbr>threads</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/lib.rs.html#113-116">Source</a> </span></div><pre class="rust item-decl"><code>pub fn max_num_threads() -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Returns the maximum number of threads that Rayon supports in a single thread pool.</p>
<p>If a higher thread count is requested by calling <code>ThreadPoolBuilder::num_threads</code> or by setting
the <code>RAYON_NUM_THREADS</code> environment variable, then it will be reduced to this maximum.</p>
<p>The value may vary between different targets, and is subject to change in new Rayon versions.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,187 @@
<!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="Creates a “fork-join” scope `s` and invokes the closure with a reference to `s`. This closure can then spawn asynchronous tasks into `s`. Those tasks may run asynchronously with respect to the closure; they may themselves spawn additional tasks into `s`. When the closure returns, it will block until all tasks that have been spawned into `s` complete."><title>scope in rayon_core - 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_core" 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 fn"><!--[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="#">scope</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../rayon_core/index.html">rayon_<wbr>core</a><span class="version">1.13.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">scope</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#example" title="Example">Example</a></li><li><a href="#a-note-on-threading" title="A note on threading">A note on threading</a></li><li><a href="#task-execution" title="Task execution">Task execution</a></li><li><a href="#accessing-stack-data" title="Accessing stack data">Accessing stack data</a></li><li><a href="#panics" title="Panics">Panics</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate rayon_<wbr>core</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_core</a></div><h1>Function <span class="fn">scope</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/scope/mod.rs.html#277-286">Source</a> </span></div><pre class="rust item-decl"><code>pub fn scope&lt;'scope, OP, R&gt;(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_core::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></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Creates a “fork-join” scope <code>s</code> and invokes the closure with a
reference to <code>s</code>. This closure can then spawn asynchronous tasks
into <code>s</code>. Those tasks may run asynchronously with respect to the
closure; they may themselves spawn additional tasks into <code>s</code>. When
the closure returns, it will block until all tasks that have been
spawned into <code>s</code> complete.</p>
<p><code>scope()</code> is a more flexible building block compared to <code>join()</code>,
since a loop can be used to spawn any number of tasks without
recursing. However, that flexibility comes at a performance price:
tasks spawned using <code>scope()</code> must be allocated onto the heap,
whereas <code>join()</code> can make exclusive use of the stack. <strong>Prefer
<code>join()</code> (or, even better, parallel iterators) where possible.</strong></p>
<h2 id="example"><a class="doc-anchor" href="#example">§</a>Example</h2>
<p>The Rayon <code>join()</code> function launches two closures and waits for them
to stop. One could implement <code>join()</code> using a scope like so, although
it would be less efficient than the real implementation:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">pub fn </span>join&lt;A,B,RA,RB&gt;(oper_a: A, oper_b: B) -&gt; (RA, RB)
<span class="kw">where </span>A: FnOnce() -&gt; RA + Send,
B: FnOnce() -&gt; RB + Send,
RA: Send,
RB: Send,
{
<span class="kw">let </span><span class="kw-2">mut </span>result_a: <span class="prelude-ty">Option</span>&lt;RA&gt; = <span class="prelude-val">None</span>;
<span class="kw">let </span><span class="kw-2">mut </span>result_b: <span class="prelude-ty">Option</span>&lt;RB&gt; = <span class="prelude-val">None</span>;
rayon::scope(|s| {
s.spawn(|<span class="kw">_</span>| result_a = <span class="prelude-val">Some</span>(oper_a()));
s.spawn(|<span class="kw">_</span>| result_b = <span class="prelude-val">Some</span>(oper_b()));
});
(result_a.unwrap(), result_b.unwrap())
}</code></pre></div><h2 id="a-note-on-threading"><a class="doc-anchor" href="#a-note-on-threading">§</a>A note on threading</h2>
<p>The closure given to <code>scope()</code> executes in the Rayon thread pool,
as do those given to <code>spawn()</code>. This means that you cant access
thread-local variables (well, you can, but they may have
unexpected values).</p>
<h2 id="task-execution"><a class="doc-anchor" href="#task-execution">§</a>Task execution</h2>
<p>Task execution potentially starts as soon as <code>spawn()</code> is called.
The task will end sometime before <code>scope()</code> returns. Note that the
<em>closure</em> given to scope may return much earlier. In general
the lifetime of a scope created like <code>scope(body)</code> goes something like this:</p>
<ul>
<li>Scope begins when <code>scope(body)</code> is called</li>
<li>Scope body <code>body()</code> is invoked
<ul>
<li>Scope tasks may be spawned</li>
</ul>
</li>
<li>Scope body returns</li>
<li>Scope tasks execute, possibly spawning more tasks</li>
<li>Once all tasks are done, scope ends and <code>scope()</code> returns</li>
</ul>
<p>To see how and when tasks are joined, consider this example:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="comment">// point start
</span>rayon::scope(|s| {
s.spawn(|s| { <span class="comment">// task s.1
</span>s.spawn(|s| { <span class="comment">// task s.1.1
</span>rayon::scope(|t| {
t.spawn(|<span class="kw">_</span>| ()); <span class="comment">// task t.1
</span>t.spawn(|<span class="kw">_</span>| ()); <span class="comment">// task t.2
</span>});
});
});
s.spawn(|s| { <span class="comment">// task s.2
</span>});
<span class="comment">// point mid
</span>});
<span class="comment">// point end</span></code></pre></div>
<p>The various tasks that are run will execute roughly like so:</p>
<div class="example-wrap"><pre class="language-notrust"><code>| (start)
|
| (scope `s` created)
+-----------------------------------------------+ (task s.2)
+-------+ (task s.1) |
| | |
| +---+ (task s.1.1) |
| | | |
| | | (scope `t` created) |
| | +----------------+ (task t.2) |
| | +---+ (task t.1) | |
| (mid) | | | | |
: | + &lt;-+------------+ (scope `t` ends) |
: | | |
|&lt;------+---+-----------------------------------+ (scope `s` ends)
|
| (end)</code></pre></div>
<p>The point here is that everything spawned into scope <code>s</code> will
terminate (at latest) at the same point right before the
original call to <code>rayon::scope</code> returns. This includes new
subtasks created by other subtasks (e.g., task <code>s.1.1</code>). If a new
scope is created (such as <code>t</code>), the things spawned into that scope
will be joined before that scope returns, which in turn occurs
before the creating task (task <code>s.1.1</code> in this case) finishes.</p>
<p>There is no guaranteed order of execution for spawns in a scope,
given that other threads may steal tasks at any time. However, they
are generally prioritized in a LIFO order on the thread from which
they were spawned. So in this example, absent any stealing, we can
expect <code>s.2</code> to execute before <code>s.1</code>, and <code>t.2</code> before <code>t.1</code>. Other
threads always steal from the other end of the deque, like FIFO
order. The idea is that “recent” tasks are most likely to be fresh
in the local CPUs cache, while other threads can steal older
“stale” tasks. For an alternate approach, consider
<a href="fn.scope_fifo.html" title="fn rayon_core::scope_fifo"><code>scope_fifo()</code></a> instead.</p>
<h2 id="accessing-stack-data"><a class="doc-anchor" href="#accessing-stack-data">§</a>Accessing stack data</h2>
<p>In general, spawned tasks may access stack data in place that
outlives the scope itself. Other data must be fully owned by the
spawned task.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>ok: Vec&lt;i32&gt; = <span class="macro">vec!</span>[<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>];
rayon::scope(|s| {
<span class="kw">let </span>bad: Vec&lt;i32&gt; = <span class="macro">vec!</span>[<span class="number">4</span>, <span class="number">5</span>, <span class="number">6</span>];
s.spawn(|<span class="kw">_</span>| {
<span class="comment">// We can access `ok` because outlives the scope `s`.
</span><span class="macro">println!</span>(<span class="string">"ok: {:?}"</span>, ok);
<span class="comment">// If we just try to use `bad` here, the closure will borrow `bad`
// (because we are just printing it out, and that only requires a
// borrow), which will result in a compilation error. Read on
// for options.
// println!("bad: {:?}", bad);
</span>});
});</code></pre></div>
<p>As the comments example above suggest, to reference <code>bad</code> we must
take ownership of it. One way to do this is to detach the closure
from the surrounding stack frame, using the <code>move</code> keyword. This
will cause it to take ownership of <em>all</em> the variables it touches,
in this case including both <code>ok</code> <em>and</em> <code>bad</code>:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>ok: Vec&lt;i32&gt; = <span class="macro">vec!</span>[<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>];
rayon::scope(|s| {
<span class="kw">let </span>bad: Vec&lt;i32&gt; = <span class="macro">vec!</span>[<span class="number">4</span>, <span class="number">5</span>, <span class="number">6</span>];
s.spawn(<span class="kw">move </span>|<span class="kw">_</span>| {
<span class="macro">println!</span>(<span class="string">"ok: {:?}"</span>, ok);
<span class="macro">println!</span>(<span class="string">"bad: {:?}"</span>, bad);
});
<span class="comment">// That closure is fine, but now we can't use `ok` anywhere else,
// since it is owned by the previous task:
// s.spawn(|_| println!("ok: {:?}", ok));
</span>});</code></pre></div>
<p>While this works, it could be a problem if we want to use <code>ok</code> elsewhere.
There are two choices. We can keep the closure as a <code>move</code> closure, but
instead of referencing the variable <code>ok</code>, we create a shadowed variable that
is a borrow of <code>ok</code> and capture <em>that</em>:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>ok: Vec&lt;i32&gt; = <span class="macro">vec!</span>[<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>];
rayon::scope(|s| {
<span class="kw">let </span>bad: Vec&lt;i32&gt; = <span class="macro">vec!</span>[<span class="number">4</span>, <span class="number">5</span>, <span class="number">6</span>];
<span class="kw">let </span>ok: <span class="kw-2">&amp;</span>Vec&lt;i32&gt; = <span class="kw-2">&amp;</span>ok; <span class="comment">// shadow the original `ok`
</span>s.spawn(<span class="kw">move </span>|<span class="kw">_</span>| {
<span class="macro">println!</span>(<span class="string">"ok: {:?}"</span>, ok); <span class="comment">// captures the shadowed version
</span><span class="macro">println!</span>(<span class="string">"bad: {:?}"</span>, bad);
});
<span class="comment">// Now we too can use the shadowed `ok`, since `&amp;Vec&lt;i32&gt;` references
// can be shared freely. Note that we need a `move` closure here though,
// because otherwise we'd be trying to borrow the shadowed `ok`,
// and that doesn't outlive `scope`.
</span>s.spawn(<span class="kw">move </span>|<span class="kw">_</span>| <span class="macro">println!</span>(<span class="string">"ok: {:?}"</span>, ok));
});</code></pre></div>
<p>Another option is not to use the <code>move</code> keyword but instead to take ownership
of individual variables:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>ok: Vec&lt;i32&gt; = <span class="macro">vec!</span>[<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>];
rayon::scope(|s| {
<span class="kw">let </span>bad: Vec&lt;i32&gt; = <span class="macro">vec!</span>[<span class="number">4</span>, <span class="number">5</span>, <span class="number">6</span>];
s.spawn(|<span class="kw">_</span>| {
<span class="comment">// Transfer ownership of `bad` into a local variable (also named `bad`).
// This will force the closure to take ownership of `bad` from the environment.
</span><span class="kw">let </span>bad = bad;
<span class="macro">println!</span>(<span class="string">"ok: {:?}"</span>, ok); <span class="comment">// `ok` is only borrowed.
</span><span class="macro">println!</span>(<span class="string">"bad: {:?}"</span>, bad); <span class="comment">// refers to our local variable, above.
</span>});
s.spawn(|<span class="kw">_</span>| <span class="macro">println!</span>(<span class="string">"ok: {:?}"</span>, ok)); <span class="comment">// we too can borrow `ok`
</span>});</code></pre></div><h2 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h2>
<p>If a panic occurs, either in the closure given to <code>scope()</code> or in
any of the spawned jobs, that panic will be propagated and the
call to <code>scope()</code> will panic. If multiple panics occurs, it is
non-deterministic which of their panic values will propagate.
Regardless, once a task is spawned using <code>scope.spawn()</code>, it will
execute, even if the spawning task should later panic. <code>scope()</code>
returns once all spawned jobs have completed, and any panics are
propagated at that point.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,65 @@
<!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="Creates a “fork-join” scope `s` with FIFO order, and invokes the closure with a reference to `s`. This closure can then spawn asynchronous tasks into `s`. Those tasks may run asynchronously with respect to the closure; they may themselves spawn additional tasks into `s`. When the closure returns, it will block until all tasks that have been spawned into `s` complete."><title>scope_fifo in rayon_core - 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_core" 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 fn"><!--[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="#">scope_fifo</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../rayon_core/index.html">rayon_<wbr>core</a><span class="version">1.13.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">scope_<wbr>fifo</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#task-execution" title="Task execution">Task execution</a></li><li><a href="#panics" title="Panics">Panics</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate rayon_<wbr>core</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_core</a></div><h1>Function <span class="fn">scope_<wbr>fifo</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/scope/mod.rs.html#366-375">Source</a> </span></div><pre class="rust item-decl"><code>pub fn scope_fifo&lt;'scope, OP, R&gt;(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_core::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></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Creates a “fork-join” scope <code>s</code> with FIFO order, and invokes the
closure with a reference to <code>s</code>. This closure can then spawn
asynchronous tasks into <code>s</code>. Those tasks may run asynchronously with
respect to the closure; they may themselves spawn additional tasks
into <code>s</code>. When the closure returns, it will block until all tasks
that have been spawned into <code>s</code> complete.</p>
<h2 id="task-execution"><a class="doc-anchor" href="#task-execution">§</a>Task execution</h2>
<p>Tasks in a <code>scope_fifo()</code> run similarly to <a href="fn.scope.html" title="fn rayon_core::scope"><code>scope()</code></a>, but theres a
difference in the order of execution. Consider a similar example:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="comment">// point start
</span>rayon::scope_fifo(|s| {
s.spawn_fifo(|s| { <span class="comment">// task s.1
</span>s.spawn_fifo(|s| { <span class="comment">// task s.1.1
</span>rayon::scope_fifo(|t| {
t.spawn_fifo(|<span class="kw">_</span>| ()); <span class="comment">// task t.1
</span>t.spawn_fifo(|<span class="kw">_</span>| ()); <span class="comment">// task t.2
</span>});
});
});
s.spawn_fifo(|s| { <span class="comment">// task s.2
</span>});
<span class="comment">// point mid
</span>});
<span class="comment">// point end</span></code></pre></div>
<p>The various tasks that are run will execute roughly like so:</p>
<div class="example-wrap"><pre class="language-notrust"><code>| (start)
|
| (FIFO scope `s` created)
+--------------------+ (task s.1)
+-------+ (task s.2) |
| | +---+ (task s.1.1)
| | | |
| | | | (FIFO scope `t` created)
| | | +----------------+ (task t.1)
| | | +---+ (task t.2) |
| (mid) | | | | |
: | | + &lt;-+------------+ (scope `t` ends)
: | | |
|&lt;------+------------+---+ (scope `s` ends)
|
| (end)</code></pre></div>
<p>Under <code>scope_fifo()</code>, the spawns are prioritized in a FIFO order on
the thread from which they were spawned, as opposed to <code>scope()</code>s
LIFO. So in this example, we can expect <code>s.1</code> to execute before
<code>s.2</code>, and <code>t.1</code> before <code>t.2</code>. Other threads also steal tasks in
FIFO order, as usual. Overall, this has roughly the same order as
the now-deprecated <a href="struct.ThreadPoolBuilder.html#method.breadth_first" title="method rayon_core::ThreadPoolBuilder::breadth_first"><code>breadth_first</code></a> option, except the effect is
isolated to a particular scope. If spawns are intermingled from any
combination of <code>scope()</code> and <code>scope_fifo()</code>, or from different
threads, their order is only specified with respect to spawns in the
same scope and thread.</p>
<p>For more details on this design, see Rayon <a href="https://github.com/rayon-rs/rfcs/blob/main/accepted/rfc0001-scope-scheduling.md">RFC #1</a>.</p>
<h2 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h2>
<p>If a panic occurs, either in the closure given to <code>scope_fifo()</code> or
in any of the spawned jobs, that panic will be propagated and the
call to <code>scope_fifo()</code> will panic. If multiple panics occurs, it is
non-deterministic which of their panic values will propagate.
Regardless, once a task is spawned using <code>scope.spawn_fifo()</code>, it
will execute, even if the spawning task should later panic.
<code>scope_fifo()</code> returns once all spawned jobs have completed, and any
panics are propagated at that point.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,38 @@
<!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="Puts the task into the Rayon thread pools job queue in the “static” or “global” scope. Just like a standard thread, this task is not tied to the current stack frame, and hence it cannot hold any references other than those with `&#39;static` lifetime. If you want to spawn a task that references stack data, use the `scope()` function to create a scope."><title>spawn in rayon_core - 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_core" 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 fn"><!--[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="#">spawn</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../rayon_core/index.html">rayon_<wbr>core</a><span class="version">1.13.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">spawn</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#panic-handling" title="Panic handling">Panic handling</a></li><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate rayon_<wbr>core</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_core</a></div><h1>Function <span class="fn">spawn</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/spawn/mod.rs.html#58-64">Source</a> </span></div><pre class="rust item-decl"><code>pub fn spawn&lt;F&gt;(func: F)<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>() + <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></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Puts the task into the Rayon thread pools job queue in the “static”
or “global” scope. Just like a standard thread, this task is not
tied to the current stack frame, and hence it cannot hold any
references other than those with <code>'static</code> lifetime. If you want
to spawn a task that references stack data, use <a href="fn.scope.html" title="fn rayon_core::scope">the <code>scope()</code>
function</a> to create a scope.</p>
<p>Since tasks spawned with this function cannot hold references into
the enclosing stack frame, you almost certainly want to use a
<code>move</code> closure as their argument (otherwise, the closure will
typically hold references to any variables from the enclosing
function that you happen to use).</p>
<p>This API assumes that the closure is executed purely for its
side-effects (i.e., it might send messages, modify data protected
by a mutex, or some such thing).</p>
<p>There is no guaranteed order of execution for spawns, given that
other threads may steal tasks at any time. However, they are
generally prioritized in a LIFO order on the thread from which
they were spawned. Other threads always steal from the other end of
the deque, like FIFO order. The idea is that “recent” tasks are
most likely to be fresh in the local CPUs cache, while other
threads can steal older “stale” tasks. For an alternate approach,
consider <a href="fn.spawn_fifo.html" title="fn rayon_core::spawn_fifo"><code>spawn_fifo()</code></a> instead.</p>
<h2 id="panic-handling"><a class="doc-anchor" href="#panic-handling">§</a>Panic handling</h2>
<p>If this closure should panic, the resulting panic will be
propagated to the panic handler registered in the <code>ThreadPoolBuilder</code>,
if any. See <a href="struct.ThreadPoolBuilder.html#method.panic_handler" title="method rayon_core::ThreadPoolBuilder::panic_handler"><code>ThreadPoolBuilder::panic_handler()</code></a> for more
details.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<p>This code creates a Rayon task that increments a global counter.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT};
<span class="kw">static </span>GLOBAL_COUNTER: AtomicUsize = ATOMIC_USIZE_INIT;
rayon::spawn(<span class="kw">move </span>|| {
GLOBAL_COUNTER.fetch_add(<span class="number">1</span>, Ordering::SeqCst);
});</code></pre></div></div></details></section></div></main></body></html>

View File

@@ -0,0 +1,7 @@
<!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="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 `move` closure)."><title>spawn_broadcast in rayon_core - 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_core" 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 fn"><!--[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="#">spawn_broadcast</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../rayon_core/index.html">rayon_<wbr>core</a><span class="version">1.13.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"></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_core</a></div><h1>Function <span class="fn">spawn_<wbr>broadcast</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/broadcast/mod.rs.html#36-42">Source</a> </span></div><pre class="rust item-decl"><code>pub fn spawn_broadcast&lt;OP&gt;(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_core::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></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></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>
<p>For more information, see the <a href="struct.ThreadPool.html#method.spawn_broadcast" title="method rayon_core::ThreadPool::spawn_broadcast"><code>ThreadPool::spawn_broadcast()</code></a> method.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,19 @@
<!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="Fires off a task into the Rayon thread pool in the “static” or “global” scope. Just like a standard thread, this task is not tied to the current stack frame, and hence it cannot hold any references other than those with `&#39;static` lifetime. If you want to spawn a task that references stack data, use the `scope_fifo()` function to create a scope."><title>spawn_fifo in rayon_core - 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_core" 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 fn"><!--[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="#">spawn_fifo</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../rayon_core/index.html">rayon_<wbr>core</a><span class="version">1.13.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">spawn_<wbr>fifo</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#panic-handling" title="Panic handling">Panic handling</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate rayon_<wbr>core</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_core</a></div><h1>Function <span class="fn">spawn_<wbr>fifo</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/spawn/mod.rs.html#130-136">Source</a> </span></div><pre class="rust item-decl"><code>pub fn spawn_fifo&lt;F&gt;(func: F)<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>() + <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></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Fires off a task into the Rayon thread pool in the “static” or
“global” scope. Just like a standard thread, this task is not
tied to the current stack frame, and hence it cannot hold any
references other than those with <code>'static</code> lifetime. If you want
to spawn a task that references stack data, use <a href="fn.scope_fifo.html" title="fn rayon_core::scope_fifo">the <code>scope_fifo()</code>
function</a> to create a scope.</p>
<p>The behavior is essentially the same as <a href="fn.spawn.html" title="fn rayon_core::spawn">the <code>spawn</code>
function</a>, except that calls from the same thread
will be prioritized in FIFO order. This is similar to the now-
deprecated <a href="struct.ThreadPoolBuilder.html#method.breadth_first" title="method rayon_core::ThreadPoolBuilder::breadth_first"><code>breadth_first</code></a> option, except the effect is isolated
to relative <code>spawn_fifo</code> calls, not all thread-pool tasks.</p>
<p>For more details on this design, see Rayon <a href="https://github.com/rayon-rs/rfcs/blob/main/accepted/rfc0001-scope-scheduling.md">RFC #1</a>.</p>
<h2 id="panic-handling"><a class="doc-anchor" href="#panic-handling">§</a>Panic handling</h2>
<p>If this closure should panic, the resulting panic will be
propagated to the panic handler registered in the <code>ThreadPoolBuilder</code>,
if any. See <a href="struct.ThreadPoolBuilder.html#method.panic_handler" title="method rayon_core::ThreadPoolBuilder::panic_handler"><code>ThreadPoolBuilder::panic_handler()</code></a> for more
details.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,8 @@
<!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="Cooperatively yields execution to local Rayon work."><title>yield_local in rayon_core - 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_core" 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 fn"><!--[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="#">yield_local</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../rayon_core/index.html">rayon_<wbr>core</a><span class="version">1.13.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"></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_core</a></div><h1>Function <span class="fn">yield_<wbr>local</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#488-493">Source</a> </span></div><pre class="rust item-decl"><code>pub fn yield_local() -&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_core::Yield">Yield</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Cooperatively yields execution to local Rayon work.</p>
<p>If the current thread is part of a rayon thread pool, this looks for a
single unit of pending work in this threads queue, then executes it.
Completion of that work might include nested work or further work stealing.</p>
<p>This is similar to <a href="fn.yield_now.html" title="fn rayon_core::yield_now"><code>yield_now()</code></a>, but does not steal from other threads.</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 this thread is not part of any pool at all.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,10 @@
<!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="Cooperatively yields execution to Rayon."><title>yield_now in rayon_core - 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_core" 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 fn"><!--[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="#">yield_now</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../rayon_core/index.html">rayon_<wbr>core</a><span class="version">1.13.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"></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_core</a></div><h1>Function <span class="fn">yield_<wbr>now</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#471-476">Source</a> </span></div><pre class="rust item-decl"><code>pub fn yield_now() -&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_core::Yield">Yield</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Cooperatively yields execution to Rayon.</p>
<p>If the current thread is part of a rayon thread pool, this looks for a
single unit of pending work in the pool, then executes it. Completion of
that work might include nested work or further work stealing.</p>
<p>This is similar to <a href="https://doc.rust-lang.org/1.93.1/std/thread/functions/fn.yield_now.html" title="fn std::thread::functions::yield_now"><code>std::thread::yield_now()</code></a>, but does not literally make
that call. If you are implementing a polling loop, you may want to also
yield to the OS scheduler yourself if no Rayon work was found.</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 this thread is not part of any pool at all.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,96 @@
<!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="Rayon-core houses the core stable APIs of Rayon."><title>rayon_core - 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_core" 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="../crates.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 mod crate"><!--[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="#">Crate rayon_core</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../rayon_core/index.html">rayon_<wbr>core</a><span class="version">1.13.0</span></h2></div><div class="sidebar-elems"><ul class="block"><li><a id="all-types" href="all.html">All Items</a></li></ul><section id="rustdoc-toc"><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#global-fallback-when-threading-is-unsupported" title="Global fallback when threading is unsupported">Global fallback when threading is unsupported</a></li><li><a href="#restricting-multiple-versions" title="Restricting multiple versions">Restricting multiple versions</a></li></ul><h3><a href="#structs">Crate Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"></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"><h1>Crate <span>rayon_<wbr>core</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/lib.rs.html#1-864">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Rayon-core houses the core stable APIs of Rayon.</p>
<p>These APIs have been mirrored in the Rayon crate and it is recommended to use these from there.</p>
<p><a href="fn.join.html" title="fn rayon_core::join"><code>join()</code></a> is used to take two closures and potentially run them in parallel.</p>
<ul>
<li>It will run in parallel if task B gets stolen before task A can finish.</li>
<li>It will run sequentially if task A finishes before task B is stolen and can continue on task B.</li>
</ul>
<p><a href="fn.scope.html" title="fn rayon_core::scope"><code>scope()</code></a> creates a scope in which you can run any number of parallel tasks.
These tasks can spawn nested tasks and scopes, but given the nature of work stealing, the order of execution can not be guaranteed.
The scope will exist until all tasks spawned within the scope have been completed.</p>
<p><a href="fn.spawn.html" title="fn rayon_core::spawn"><code>spawn()</code></a> add a task into the static or global scope, or a local scope created by the <a href="fn.scope.html" title="fn rayon_core::scope"><code>scope()</code></a> function.</p>
<p><a href="struct.ThreadPool.html" title="struct rayon_core::ThreadPool"><code>ThreadPool</code></a> can be used to create your own thread pools (using <a href="struct.ThreadPoolBuilder.html" title="struct rayon_core::ThreadPoolBuilder"><code>ThreadPoolBuilder</code></a>) or to customize the global one.
Tasks spawned within the pool (using <a href="struct.ThreadPool.html#method.install" title="method rayon_core::ThreadPool::install"><code>install()</code></a>, <a href="struct.ThreadPool.html#method.join" title="method rayon_core::ThreadPool::join"><code>join()</code></a>, etc.) will be added to a deque,
where it becomes available for work stealing from other threads in the local thread pool.</p>
<h2 id="global-fallback-when-threading-is-unsupported"><a class="doc-anchor" href="#global-fallback-when-threading-is-unsupported">§</a>Global fallback when threading is unsupported</h2>
<p>Rayon uses <code>std</code> APIs for threading, but some targets have incomplete implementations that
always return <code>Unsupported</code> errors. The WebAssembly <code>wasm32-unknown-unknown</code> and <code>wasm32-wasi</code>
targets are notable examples of this. Rather than panicking on the unsupported error when
creating the implicit global thread pool, Rayon configures a fallback mode instead.</p>
<p>This fallback mode mostly functions as if it were using a single-threaded “pool”, like setting
<code>RAYON_NUM_THREADS=1</code>. For example, <code>join</code> will execute its two closures sequentially, since
there is no other thread to share the work. However, since the pool is not running independent
of the main thread, non-blocking calls like <code>spawn</code> may not execute at all, unless a lower-
priority call like <code>broadcast</code> gives them an opening. The fallback mode does not try to emulate
anything like thread preemption or <code>async</code> task switching, but <code>yield_now</code> or <code>yield_local</code>
can also volunteer execution time.</p>
<p>Explicit <code>ThreadPoolBuilder</code> methods always report their error without any fallback.</p>
<h2 id="restricting-multiple-versions"><a class="doc-anchor" href="#restricting-multiple-versions">§</a>Restricting multiple versions</h2>
<p>In order to ensure proper coordination between thread pools, and especially
to make sure theres only one global thread pool, <code>rayon-core</code> is actively
restricted from building multiple versions of itself into a single target.
You may see a build error like this in violation:</p>
<div class="example-wrap"><pre class="language-text"><code>error: native library `rayon-core` is being linked to by more
than one package, and can only be linked to by one package</code></pre></div>
<p>While we strive to keep <code>rayon-core</code> semver-compatible, its still
possible to arrive at this situation if different crates have overly
restrictive tilde or inequality requirements for <code>rayon-core</code>. The
conflicting requirements will need to be resolved before the build will
succeed.</p>
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.BroadcastContext.html" title="struct rayon_core::BroadcastContext">Broadcast<wbr>Context</a></dt><dd>Provides context to a closure called by <code>broadcast</code>.</dd><dt><a class="struct" href="struct.Configuration.html" title="struct rayon_core::Configuration">Configuration</a><wbr><span class="stab deprecated" title="">Deprecated</span></dt><dd>Contains the rayon thread pool configuration. Use <a href="struct.ThreadPoolBuilder.html" title="struct rayon_core::ThreadPoolBuilder"><code>ThreadPoolBuilder</code></a> instead.</dd><dt><a class="struct" href="struct.FnContext.html" title="struct rayon_core::FnContext">FnContext</a></dt><dd>Provides the calling context to a closure called by <code>join_context</code>.</dd><dt><a class="struct" href="struct.Scope.html" title="struct rayon_core::Scope">Scope</a></dt><dd>Represents a fork-join scope which can be used to spawn any number of tasks.
See <a href="fn.scope.html" title="fn rayon_core::scope"><code>scope()</code></a> for more information.</dd><dt><a class="struct" href="struct.ScopeFifo.html" title="struct rayon_core::ScopeFifo">Scope<wbr>Fifo</a></dt><dd>Represents a fork-join scope which can be used to spawn any number of tasks.
Those spawned from the same thread are prioritized in relative FIFO order.
See <a href="fn.scope_fifo.html" title="fn rayon_core::scope_fifo"><code>scope_fifo()</code></a> for more information.</dd><dt><a class="struct" href="struct.ThreadBuilder.html" title="struct rayon_core::ThreadBuilder">Thread<wbr>Builder</a></dt><dd>Thread builder used for customization via <a href="struct.ThreadPoolBuilder.html#method.spawn_handler" title="method rayon_core::ThreadPoolBuilder::spawn_handler"><code>ThreadPoolBuilder::spawn_handler()</code></a>.</dd><dt><a class="struct" href="struct.ThreadPool.html" title="struct rayon_core::ThreadPool">Thread<wbr>Pool</a></dt><dd>Represents a user-created <a href="https://en.wikipedia.org/wiki/Thread_pool">thread pool</a>.</dd><dt><a class="struct" href="struct.ThreadPoolBuildError.html" title="struct rayon_core::ThreadPoolBuildError">Thread<wbr>Pool<wbr>Build<wbr>Error</a></dt><dd>Error when initializing a thread pool.</dd><dt><a class="struct" href="struct.ThreadPoolBuilder.html" title="struct rayon_core::ThreadPoolBuilder">Thread<wbr>Pool<wbr>Builder</a></dt><dd>Used to create a new <a href="struct.ThreadPool.html" title="struct rayon_core::ThreadPool"><code>ThreadPool</code></a> or to configure the global rayon thread pool.</dd></dl><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><dl class="item-table"><dt><a class="enum" href="enum.Yield.html" title="enum rayon_core::Yield">Yield</a></dt><dd>Result of <a href="fn.yield_now.html" title="fn rayon_core::yield_now"><code>yield_now()</code></a> or <a href="fn.yield_local.html" title="fn rayon_core::yield_local"><code>yield_local()</code></a>.</dd></dl><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><dl class="item-table"><dt><a class="fn" href="fn.broadcast.html" title="fn rayon_core::broadcast">broadcast</a></dt><dd>Executes <code>op</code> within every thread in the current thread pool. If this is
called from a non-Rayon thread, it will execute in the global thread pool.
Any attempts to use <code>join</code>, <code>scope</code>, or parallel iterators will then operate
within that thread pool. When the call has completed on each thread, returns
a vector containing all of their return values.</dd><dt><a class="fn" href="fn.current_num_threads.html" title="fn rayon_core::current_num_threads">current_<wbr>num_<wbr>threads</a></dt><dd>Returns the number of threads in the current registry. If this
code is executing within a Rayon thread pool, then this will be
the number of threads for the thread pool of the current
thread. Otherwise, it will be the number of threads for the global
thread pool.</dd><dt><a class="fn" href="fn.current_thread_has_pending_tasks.html" title="fn rayon_core::current_thread_has_pending_tasks">current_<wbr>thread_<wbr>has_<wbr>pending_<wbr>tasks</a></dt><dd>If called from a Rayon worker thread, indicates whether that
threads local deque still has pending tasks. Otherwise, returns
<code>None</code>. For more information, see <a href="struct.ThreadPool.html#method.current_thread_has_pending_tasks" title="method rayon_core::ThreadPool::current_thread_has_pending_tasks">the
<code>ThreadPool::current_thread_has_pending_tasks()</code> method</a>.</dd><dt><a class="fn" href="fn.current_thread_index.html" title="fn rayon_core::current_thread_index">current_<wbr>thread_<wbr>index</a></dt><dd>If called from a Rayon worker thread, returns the index of that
thread within its current pool; if not called from a Rayon thread,
returns <code>None</code>.</dd><dt><a class="fn" href="fn.in_place_scope.html" title="fn rayon_core::in_place_scope">in_<wbr>place_<wbr>scope</a></dt><dd>Creates a “fork-join” scope <code>s</code> and invokes the closure with a
reference to <code>s</code>. This closure can then spawn asynchronous tasks
into <code>s</code>. Those tasks may run asynchronously with respect to the
closure; they may themselves spawn additional tasks into <code>s</code>. When
the closure returns, it will block until all tasks that have been
spawned into <code>s</code> complete.</dd><dt><a class="fn" href="fn.in_place_scope_fifo.html" title="fn rayon_core::in_place_scope_fifo">in_<wbr>place_<wbr>scope_<wbr>fifo</a></dt><dd>Creates a “fork-join” scope <code>s</code> with FIFO order, and invokes the
closure with a reference to <code>s</code>. This closure can then spawn
asynchronous tasks into <code>s</code>. Those tasks may run asynchronously with
respect to the closure; they may themselves spawn additional tasks
into <code>s</code>. When the closure returns, it will block until all tasks
that have been spawned into <code>s</code> complete.</dd><dt><a class="fn" href="fn.initialize.html" title="fn rayon_core::initialize">initialize</a><wbr><span class="stab deprecated" title="">Deprecated</span></dt><dd>Deprecated in favor of <code>ThreadPoolBuilder::build_global</code>.</dd><dt><a class="fn" href="fn.join.html" title="fn rayon_core::join">join</a></dt><dd>Takes two closures and <em>potentially</em> runs them in parallel. It
returns a pair of the results from those closures.</dd><dt><a class="fn" href="fn.join_context.html" title="fn rayon_core::join_context">join_<wbr>context</a></dt><dd>Identical to <code>join</code>, except that the closures have a parameter
that provides context for the way the closure has been called,
especially indicating whether theyre executing on a different
thread than where <code>join_context</code> was called. This will occur if
the second job is stolen by a different thread, or if
<code>join_context</code> was called from outside the thread pool to begin
with.</dd><dt><a class="fn" href="fn.max_num_threads.html" title="fn rayon_core::max_num_threads">max_<wbr>num_<wbr>threads</a></dt><dd>Returns the maximum number of threads that Rayon supports in a single thread pool.</dd><dt><a class="fn" href="fn.scope.html" title="fn rayon_core::scope">scope</a></dt><dd>Creates a “fork-join” scope <code>s</code> and invokes the closure with a
reference to <code>s</code>. This closure can then spawn asynchronous tasks
into <code>s</code>. Those tasks may run asynchronously with respect to the
closure; they may themselves spawn additional tasks into <code>s</code>. When
the closure returns, it will block until all tasks that have been
spawned into <code>s</code> complete.</dd><dt><a class="fn" href="fn.scope_fifo.html" title="fn rayon_core::scope_fifo">scope_<wbr>fifo</a></dt><dd>Creates a “fork-join” scope <code>s</code> with FIFO order, and invokes the
closure with a reference to <code>s</code>. This closure can then spawn
asynchronous tasks into <code>s</code>. Those tasks may run asynchronously with
respect to the closure; they may themselves spawn additional tasks
into <code>s</code>. When the closure returns, it will block until all tasks
that have been spawned into <code>s</code> complete.</dd><dt><a class="fn" href="fn.spawn.html" title="fn rayon_core::spawn">spawn</a></dt><dd>Puts the task into the Rayon thread pools job queue in the “static”
or “global” scope. Just like a standard thread, this task is not
tied to the current stack frame, and hence it cannot hold any
references other than those with <code>'static</code> lifetime. If you want
to spawn a task that references stack data, use <a href="fn.scope.html" title="fn rayon_core::scope">the <code>scope()</code>
function</a> to create a scope.</dd><dt><a class="fn" href="fn.spawn_broadcast.html" title="fn rayon_core::spawn_broadcast">spawn_<wbr>broadcast</a></dt><dd>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).</dd><dt><a class="fn" href="fn.spawn_fifo.html" title="fn rayon_core::spawn_fifo">spawn_<wbr>fifo</a></dt><dd>Fires off a task into the Rayon thread pool in the “static” or
“global” scope. Just like a standard thread, this task is not
tied to the current stack frame, and hence it cannot hold any
references other than those with <code>'static</code> lifetime. If you want
to spawn a task that references stack data, use <a href="fn.scope_fifo.html" title="fn rayon_core::scope_fifo">the <code>scope_fifo()</code>
function</a> to create a scope.</dd><dt><a class="fn" href="fn.yield_local.html" title="fn rayon_core::yield_local">yield_<wbr>local</a></dt><dd>Cooperatively yields execution to local Rayon work.</dd><dt><a class="fn" href="fn.yield_now.html" title="fn rayon_core::yield_now">yield_<wbr>now</a></dt><dd>Cooperatively yields execution to Rayon.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../rayon_core/fn.join.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../rayon_core/fn.join.html">../../rayon_core/fn.join.html</a>...</p>
<script>location.replace("../../rayon_core/fn.join.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../rayon_core/fn.join_context.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../rayon_core/fn.join_context.html">../../rayon_core/fn.join_context.html</a>...</p>
<script>location.replace("../../rayon_core/fn.join_context.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../rayon_core/struct.ThreadBuilder.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../rayon_core/struct.ThreadBuilder.html">../../rayon_core/struct.ThreadBuilder.html</a>...</p>
<script>location.replace("../../rayon_core/struct.ThreadBuilder.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../rayon_core/fn.in_place_scope.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../rayon_core/fn.in_place_scope.html">../../rayon_core/fn.in_place_scope.html</a>...</p>
<script>location.replace("../../rayon_core/fn.in_place_scope.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../rayon_core/fn.in_place_scope_fifo.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../rayon_core/fn.in_place_scope_fifo.html">../../rayon_core/fn.in_place_scope_fifo.html</a>...</p>
<script>location.replace("../../rayon_core/fn.in_place_scope_fifo.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../rayon_core/fn.scope.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../rayon_core/fn.scope.html">../../rayon_core/fn.scope.html</a>...</p>
<script>location.replace("../../rayon_core/fn.scope.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../rayon_core/fn.scope_fifo.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../rayon_core/fn.scope_fifo.html">../../rayon_core/fn.scope_fifo.html</a>...</p>
<script>location.replace("../../rayon_core/fn.scope_fifo.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../rayon_core/struct.Scope.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../rayon_core/struct.Scope.html">../../rayon_core/struct.Scope.html</a>...</p>
<script>location.replace("../../rayon_core/struct.Scope.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../rayon_core/struct.ScopeFifo.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../rayon_core/struct.ScopeFifo.html">../../rayon_core/struct.ScopeFifo.html</a>...</p>
<script>location.replace("../../rayon_core/struct.ScopeFifo.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"enum":["Yield"],"fn":["broadcast","current_num_threads","current_thread_has_pending_tasks","current_thread_index","in_place_scope","in_place_scope_fifo","initialize","join","join_context","max_num_threads","scope","scope_fifo","spawn","spawn_broadcast","spawn_fifo","yield_local","yield_now"],"struct":["BroadcastContext","Configuration","FnContext","Scope","ScopeFifo","ThreadBuilder","ThreadPool","ThreadPoolBuildError","ThreadPoolBuilder"]};

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../rayon_core/fn.spawn.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../rayon_core/fn.spawn.html">../../rayon_core/fn.spawn.html</a>...</p>
<script>location.replace("../../rayon_core/fn.spawn.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../rayon_core/fn.spawn_fifo.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../rayon_core/fn.spawn_fifo.html">../../rayon_core/fn.spawn_fifo.html</a>...</p>
<script>location.replace("../../rayon_core/fn.spawn_fifo.html" + location.search + location.hash);</script>
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../rayon_core/enum.Yield.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../rayon_core/enum.Yield.html">../../rayon_core/enum.Yield.html</a>...</p>
<script>location.replace("../../rayon_core/enum.Yield.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../rayon_core/fn.current_thread_has_pending_tasks.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../rayon_core/fn.current_thread_has_pending_tasks.html">../../rayon_core/fn.current_thread_has_pending_tasks.html</a>...</p>
<script>location.replace("../../rayon_core/fn.current_thread_has_pending_tasks.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../rayon_core/fn.current_thread_index.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../rayon_core/fn.current_thread_index.html">../../rayon_core/fn.current_thread_index.html</a>...</p>
<script>location.replace("../../rayon_core/fn.current_thread_index.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../rayon_core/fn.yield_local.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../rayon_core/fn.yield_local.html">../../rayon_core/fn.yield_local.html</a>...</p>
<script>location.replace("../../rayon_core/fn.yield_local.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../rayon_core/fn.yield_now.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../rayon_core/fn.yield_now.html">../../rayon_core/fn.yield_now.html</a>...</p>
<script>location.replace("../../rayon_core/fn.yield_now.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../rayon_core/struct.ThreadPool.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../rayon_core/struct.ThreadPool.html">../../rayon_core/struct.ThreadPool.html</a>...</p>
<script>location.replace("../../rayon_core/struct.ThreadPool.html" + location.search + location.hash);</script>
</body>
</html>