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

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,4 @@
<!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="Parallel iterator types for arrays (`[T; N]`)"><title>rayon::array - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="rayon" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[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="#">Module array</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../rayon/index.html">rayon</a><span class="version">1.11.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module array</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate rayon</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">rayon</a></div><h1>Module <span>array</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/array.rs.html#1-85">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Parallel iterator types for <a href="https://doc.rust-lang.org/1.93.1/std/primitive.array.html" title="primitive array">arrays</a> (<code>[T; N]</code>)</p>
<p>You will rarely need to interact with this module directly unless you need
to name one of the iterator types.</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.IntoIter.html" title="struct rayon::array::IntoIter">Into<wbr>Iter</a></dt><dd>Parallel iterator that moves out of an array.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":["IntoIter"]};

File diff suppressed because one or more lines are too long

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="This module contains the parallel iterator types for heaps (`BinaryHeap&#60;T&#62;`). You will rarely need to interact with it directly unless you have need to name one of the iterator types."><title>rayon::collections::binary_heap - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="rayon" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[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="#">Module binary_heap</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../rayon/index.html">rayon</a><span class="version">1.11.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module binary_<wbr>heap</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In rayon::<wbr>collections</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">rayon</a>::<wbr><a href="../index.html">collections</a></div><h1>Module <span>binary_<wbr>heap</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/collections/binary_heap.rs.html#1-129">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>This module contains the parallel iterator types for heaps
(<code>BinaryHeap&lt;T&gt;</code>). You will rarely need to interact with it directly
unless you have need to name one of the iterator types.</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.Drain.html" title="struct rayon::collections::binary_heap::Drain">Drain</a></dt><dd>Draining parallel iterator that moves out of a binary heap,
but keeps the total capacity.</dd><dt><a class="struct" href="struct.IntoIter.html" title="struct rayon::collections::binary_heap::IntoIter">Into<wbr>Iter</a></dt><dd>Parallel iterator over a binary heap</dd><dt><a class="struct" href="struct.Iter.html" title="struct rayon::collections::binary_heap::Iter">Iter</a></dt><dd>Parallel iterator over an immutable reference to a binary heap</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":["Drain","IntoIter","Iter"]};

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,4 @@
<!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="This module contains the parallel iterator types for B-Tree maps (`BTreeMap&#60;K, V&#62;`). You will rarely need to interact with it directly unless you have need to name one of the iterator types."><title>rayon::collections::btree_map - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="rayon" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[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="#">Module btree_map</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../rayon/index.html">rayon</a><span class="version">1.11.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module btree_<wbr>map</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In rayon::<wbr>collections</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">rayon</a>::<wbr><a href="../index.html">collections</a></div><h1>Module <span>btree_<wbr>map</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/collections/btree_map.rs.html#1-66">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>This module contains the parallel iterator types for B-Tree maps
(<code>BTreeMap&lt;K, V&gt;</code>). You will rarely need to interact with it directly
unless you have need to name one of the iterator types.</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.IntoIter.html" title="struct rayon::collections::btree_map::IntoIter">Into<wbr>Iter</a></dt><dd>Parallel iterator over a B-Tree map</dd><dt><a class="struct" href="struct.Iter.html" title="struct rayon::collections::btree_map::Iter">Iter</a></dt><dd>Parallel iterator over an immutable reference to a B-Tree map</dd><dt><a class="struct" href="struct.IterMut.html" title="struct rayon::collections::btree_map::IterMut">IterMut</a></dt><dd>Parallel iterator over a mutable reference to a B-Tree map</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":["IntoIter","Iter","IterMut"]};

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,4 @@
<!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="This module contains the parallel iterator types for B-Tree sets (`BTreeSet&#60;T&#62;`). You will rarely need to interact with it directly unless you have need to name one of the iterator types."><title>rayon::collections::btree_set - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="rayon" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[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="#">Module btree_set</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../rayon/index.html">rayon</a><span class="version">1.11.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module btree_<wbr>set</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In rayon::<wbr>collections</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">rayon</a>::<wbr><a href="../index.html">collections</a></div><h1>Module <span>btree_<wbr>set</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/collections/btree_set.rs.html#1-50">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>This module contains the parallel iterator types for B-Tree sets
(<code>BTreeSet&lt;T&gt;</code>). You will rarely need to interact with it directly
unless you have need to name one of the iterator types.</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.IntoIter.html" title="struct rayon::collections::btree_set::IntoIter">Into<wbr>Iter</a></dt><dd>Parallel iterator over a B-Tree set</dd><dt><a class="struct" href="struct.Iter.html" title="struct rayon::collections::btree_set::Iter">Iter</a></dt><dd>Parallel iterator over an immutable reference to a B-Tree set</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":["IntoIter","Iter"]};

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,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="This module contains the parallel iterator types for hash maps (`HashMap&#60;K, V&#62;`). You will rarely need to interact with it directly unless you have need to name one of the iterator types."><title>rayon::collections::hash_map - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="rayon" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[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="#">Module hash_map</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../rayon/index.html">rayon</a><span class="version">1.11.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module hash_<wbr>map</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In rayon::<wbr>collections</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">rayon</a>::<wbr><a href="../index.html">collections</a></div><h1>Module <span>hash_<wbr>map</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/collections/hash_map.rs.html#1-93">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>This module contains the parallel iterator types for hash maps
(<code>HashMap&lt;K, V&gt;</code>). You will rarely need to interact with it directly
unless you have need to name one of the iterator types.</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.Drain.html" title="struct rayon::collections::hash_map::Drain">Drain</a></dt><dd>Draining parallel iterator that moves out of a hash map,
but keeps the total capacity.</dd><dt><a class="struct" href="struct.IntoIter.html" title="struct rayon::collections::hash_map::IntoIter">Into<wbr>Iter</a></dt><dd>Parallel iterator over a hash map</dd><dt><a class="struct" href="struct.Iter.html" title="struct rayon::collections::hash_map::Iter">Iter</a></dt><dd>Parallel iterator over an immutable reference to a hash map</dd><dt><a class="struct" href="struct.IterMut.html" title="struct rayon::collections::hash_map::IterMut">IterMut</a></dt><dd>Parallel iterator over a mutable reference to a hash map</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":["Drain","IntoIter","Iter","IterMut"]};

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,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="This module contains the parallel iterator types for hash sets (`HashSet&#60;T&#62;`). You will rarely need to interact with it directly unless you have need to name one of the iterator types."><title>rayon::collections::hash_set - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="rayon" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[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="#">Module hash_set</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../rayon/index.html">rayon</a><span class="version">1.11.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module hash_<wbr>set</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In rayon::<wbr>collections</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">rayon</a>::<wbr><a href="../index.html">collections</a></div><h1>Module <span>hash_<wbr>set</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/collections/hash_set.rs.html#1-79">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>This module contains the parallel iterator types for hash sets
(<code>HashSet&lt;T&gt;</code>). You will rarely need to interact with it directly
unless you have need to name one of the iterator types.</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.Drain.html" title="struct rayon::collections::hash_set::Drain">Drain</a></dt><dd>Draining parallel iterator that moves out of a hash set,
but keeps the total capacity.</dd><dt><a class="struct" href="struct.IntoIter.html" title="struct rayon::collections::hash_set::IntoIter">Into<wbr>Iter</a></dt><dd>Parallel iterator over a hash set</dd><dt><a class="struct" href="struct.Iter.html" title="struct rayon::collections::hash_set::Iter">Iter</a></dt><dd>Parallel iterator over an immutable reference to a hash set</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":["Drain","IntoIter","Iter"]};

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,18 @@
<!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="Parallel iterator types for standard collections"><title>rayon::collections - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="rayon" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[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="#">Module collections</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../rayon/index.html">rayon</a><span class="version">1.11.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module collections</a></h2><h3><a href="#modules">Module Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate rayon</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">rayon</a></div><h1>Module <span>collections</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/collections/mod.rs.html#1-84">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Parallel iterator types for <a href="https://doc.rust-lang.org/1.93.1/std/collections/index.html" title="mod std::collections">standard collections</a></p>
<p>You will rarely need to interact with this module directly unless you need
to name one of the iterator types.</p>
</div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="binary_heap/index.html" title="mod rayon::collections::binary_heap">binary_<wbr>heap</a></dt><dd>This module contains the parallel iterator types for heaps
(<code>BinaryHeap&lt;T&gt;</code>). You will rarely need to interact with it directly
unless you have need to name one of the iterator types.</dd><dt><a class="mod" href="btree_map/index.html" title="mod rayon::collections::btree_map">btree_<wbr>map</a></dt><dd>This module contains the parallel iterator types for B-Tree maps
(<code>BTreeMap&lt;K, V&gt;</code>). You will rarely need to interact with it directly
unless you have need to name one of the iterator types.</dd><dt><a class="mod" href="btree_set/index.html" title="mod rayon::collections::btree_set">btree_<wbr>set</a></dt><dd>This module contains the parallel iterator types for B-Tree sets
(<code>BTreeSet&lt;T&gt;</code>). You will rarely need to interact with it directly
unless you have need to name one of the iterator types.</dd><dt><a class="mod" href="hash_map/index.html" title="mod rayon::collections::hash_map">hash_<wbr>map</a></dt><dd>This module contains the parallel iterator types for hash maps
(<code>HashMap&lt;K, V&gt;</code>). You will rarely need to interact with it directly
unless you have need to name one of the iterator types.</dd><dt><a class="mod" href="hash_set/index.html" title="mod rayon::collections::hash_set">hash_<wbr>set</a></dt><dd>This module contains the parallel iterator types for hash sets
(<code>HashSet&lt;T&gt;</code>). You will rarely need to interact with it directly
unless you have need to name one of the iterator types.</dd><dt><a class="mod" href="linked_list/index.html" title="mod rayon::collections::linked_list">linked_<wbr>list</a></dt><dd>This module contains the parallel iterator types for linked lists
(<code>LinkedList&lt;T&gt;</code>). You will rarely need to interact with it directly
unless you have need to name one of the iterator types.</dd><dt><a class="mod" href="vec_deque/index.html" title="mod rayon::collections::vec_deque">vec_<wbr>deque</a></dt><dd>This module contains the parallel iterator types for double-ended queues
(<code>VecDeque&lt;T&gt;</code>). You will rarely need to interact with it directly
unless you have need to name one of the iterator types.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1,4 @@
<!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="This module contains the parallel iterator types for linked lists (`LinkedList&#60;T&#62;`). You will rarely need to interact with it directly unless you have need to name one of the iterator types."><title>rayon::collections::linked_list - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="rayon" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[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="#">Module linked_list</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../rayon/index.html">rayon</a><span class="version">1.11.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module linked_<wbr>list</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In rayon::<wbr>collections</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">rayon</a>::<wbr><a href="../index.html">collections</a></div><h1>Module <span>linked_<wbr>list</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/collections/linked_list.rs.html#1-66">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>This module contains the parallel iterator types for linked lists
(<code>LinkedList&lt;T&gt;</code>). You will rarely need to interact with it directly
unless you have need to name one of the iterator types.</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.IntoIter.html" title="struct rayon::collections::linked_list::IntoIter">Into<wbr>Iter</a></dt><dd>Parallel iterator over a linked list</dd><dt><a class="struct" href="struct.Iter.html" title="struct rayon::collections::linked_list::Iter">Iter</a></dt><dd>Parallel iterator over an immutable reference to a linked list</dd><dt><a class="struct" href="struct.IterMut.html" title="struct rayon::collections::linked_list::IterMut">IterMut</a></dt><dd>Parallel iterator over a mutable reference to a linked list</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":["IntoIter","Iter","IterMut"]};

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 @@
window.SIDEBAR_ITEMS = {"mod":["binary_heap","btree_map","btree_set","hash_map","hash_set","linked_list","vec_deque"]};

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="This module contains the parallel iterator types for double-ended queues (`VecDeque&#60;T&#62;`). You will rarely need to interact with it directly unless you have need to name one of the iterator types."><title>rayon::collections::vec_deque - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="rayon" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[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="#">Module vec_deque</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../rayon/index.html">rayon</a><span class="version">1.11.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module vec_<wbr>deque</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In rayon::<wbr>collections</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">rayon</a>::<wbr><a href="../index.html">collections</a></div><h1>Module <span>vec_<wbr>deque</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/collections/vec_deque.rs.html#1-159">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>This module contains the parallel iterator types for double-ended queues
(<code>VecDeque&lt;T&gt;</code>). You will rarely need to interact with it directly
unless you have need to name one of the iterator types.</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.Drain.html" title="struct rayon::collections::vec_deque::Drain">Drain</a></dt><dd>Draining parallel iterator that moves a range out of a double-ended queue,
but keeps the total capacity.</dd><dt><a class="struct" href="struct.IntoIter.html" title="struct rayon::collections::vec_deque::IntoIter">Into<wbr>Iter</a></dt><dd>Parallel iterator over a double-ended queue</dd><dt><a class="struct" href="struct.Iter.html" title="struct rayon::collections::vec_deque::Iter">Iter</a></dt><dd>Parallel iterator over an immutable reference to a double-ended queue</dd><dt><a class="struct" href="struct.IterMut.html" title="struct rayon::collections::vec_deque::IterMut">IterMut</a></dt><dd>Parallel iterator over a mutable reference to a double-ended queue</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":["Drain","IntoIter","Iter","IterMut"]};

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,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 - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="rayon" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc 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/index.html">rayon</a><span class="version">1.11.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</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-22">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::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::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 - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="rayon" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc 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/index.html">rayon</a><span class="version">1.11.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">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</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">rayon</a></div><h1>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">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::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,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 - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="rayon" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc 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/index.html">rayon</a><span class="version">1.11.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">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</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">rayon</a></div><h1>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">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::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::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 - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="rayon" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc 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/index.html">rayon</a><span class="version">1.11.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">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</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">rayon</a></div><h1>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-400">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::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 - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="rayon" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc 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/index.html">rayon</a><span class="version">1.11.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">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</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">rayon</a></div><h1>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-451">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::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,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 - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="rayon" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc 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/index.html">rayon</a><span class="version">1.11.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">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</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">rayon</a></div><h1>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-98">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 - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="rayon" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc 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/index.html">rayon</a><span class="version">1.11.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</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-120">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::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::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 - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="rayon" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc 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/index.html">rayon</a><span class="version">1.11.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</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">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 - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="rayon" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc 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/index.html">rayon</a><span class="version">1.11.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">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</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">rayon</a></div><h1>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-280">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::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::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 - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="rayon" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc 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/index.html">rayon</a><span class="version">1.11.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">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</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">rayon</a></div><h1>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-369">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::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::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::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 - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="rayon" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc 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/index.html">rayon</a><span class="version">1.11.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">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</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">rayon</a></div><h1>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-60">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::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::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::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 - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="rayon" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc 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/index.html">rayon</a><span class="version">1.11.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</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-38">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::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::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 - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="rayon" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc 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/index.html">rayon</a><span class="version">1.11.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">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</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">rayon</a></div><h1>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-132">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::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::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::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::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 - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="rayon" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc 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/index.html">rayon</a><span class="version">1.11.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</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">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::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::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 - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="rayon" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc 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/index.html">rayon</a><span class="version">1.11.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</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">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::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>

118
target/doc/rayon/index.html Normal file
View File

@@ -0,0 +1,118 @@
<!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 is a data-parallelism library that makes it easy to convert sequential computations into parallel."><title>rayon - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="rayon" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="../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</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../rayon/index.html">rayon</a><span class="version">1.11.0</span></h2></div><div class="sidebar-elems"><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="#how-to-use-rayon" title="How to use Rayon">How to use Rayon</a></li><li><a href="#basic-usage-and-the-rayon-prelude" title="Basic usage and the Rayon prelude">Basic usage and the Rayon prelude</a></li><li><a href="#crate-layout" title="Crate Layout">Crate Layout</a></li><li><a href="#targets-without-threading" title="Targets without threading">Targets without threading</a></li><li><a href="#other-questions" title="Other questions?">Other questions?</a></li></ul><h3><a href="#modules">Crate Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li><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</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/lib.rs.html#1-156">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Rayon is a data-parallelism library that makes it easy to convert sequential
computations into parallel.</p>
<p>It is lightweight and convenient for introducing parallelism into existing
code. It guarantees data-race free executions and takes advantage of
parallelism when sensible, based on work-load at runtime.</p>
<h2 id="how-to-use-rayon"><a class="doc-anchor" href="#how-to-use-rayon">§</a>How to use Rayon</h2>
<p>There are two ways to use Rayon:</p>
<ul>
<li><strong>High-level parallel constructs</strong> are the simplest way to use Rayon and also
typically the most efficient.
<ul>
<li><a href="iter/index.html" title="mod rayon::iter">Parallel iterators</a> make it easy to convert a sequential iterator to
execute in parallel.
<ul>
<li>The <a href="iter/trait.ParallelIterator.html" title="trait rayon::iter::ParallelIterator"><code>ParallelIterator</code></a> trait defines general methods for all parallel iterators.</li>
<li>The <a href="iter/trait.IndexedParallelIterator.html" title="trait rayon::iter::IndexedParallelIterator"><code>IndexedParallelIterator</code></a> trait adds methods for iterators that support random
access.</li>
</ul>
</li>
<li>The <a href="slice/trait.ParallelSliceMut.html#method.par_sort" title="method rayon::slice::ParallelSliceMut::par_sort"><code>par_sort</code></a> method sorts <code>&amp;mut [T]</code> slices (or vectors) in parallel.</li>
<li><a href="iter/trait.ParallelExtend.html#tymethod.par_extend" title="method rayon::iter::ParallelExtend::par_extend"><code>par_extend</code></a> can be used to efficiently grow collections with items produced
by a parallel iterator.</li>
</ul>
</li>
<li><strong>Custom tasks</strong> let you divide your work into parallel tasks yourself.
<ul>
<li><a href="fn.join.html" title="fn rayon::join"><code>join</code></a> is used to subdivide a task into two pieces.</li>
<li><a href="fn.scope.html" title="fn rayon::scope"><code>scope</code></a> creates a scope within which you can create any number of parallel tasks.</li>
<li><a href="struct.ThreadPoolBuilder.html" title="struct rayon::ThreadPoolBuilder"><code>ThreadPoolBuilder</code></a> can be used to create your own thread pools or customize
the global one.</li>
</ul>
</li>
</ul>
<h2 id="basic-usage-and-the-rayon-prelude"><a class="doc-anchor" href="#basic-usage-and-the-rayon-prelude">§</a>Basic usage and the Rayon prelude</h2>
<p>First, you will need to add <code>rayon</code> to your <code>Cargo.toml</code>.</p>
<p>Next, to use parallel iterators or the other high-level methods,
you need to import several traits. Those traits are bundled into
the module <a href="prelude/index.html" title="mod rayon::prelude"><code>rayon::prelude</code></a>. It is recommended that you import
all of these traits at once by adding <code>use rayon::prelude::*</code> at
the top of each module that uses Rayon methods.</p>
<p>These traits give you access to the <code>par_iter</code> method which provides
parallel implementations of many iterative functions such as <a href="iter/trait.ParallelIterator.html#method.map" title="method rayon::iter::ParallelIterator::map"><code>map</code></a>,
<a href="iter/trait.ParallelIterator.html#method.for_each" title="method rayon::iter::ParallelIterator::for_each"><code>for_each</code></a>, <a href="iter/trait.ParallelIterator.html#method.filter" title="method rayon::iter::ParallelIterator::filter"><code>filter</code></a>, <a href="iter/trait.ParallelIterator.html#method.fold" title="method rayon::iter::ParallelIterator::fold"><code>fold</code></a>, and <a href="iter/trait.ParallelIterator.html#provided-methods" title="trait rayon::iter::ParallelIterator">more</a>.</p>
<h2 id="crate-layout"><a class="doc-anchor" href="#crate-layout">§</a>Crate Layout</h2>
<p>Rayon extends many of the types found in the standard library with
parallel iterator implementations. The modules in the <code>rayon</code>
crate mirror <a href="https://doc.rust-lang.org/1.93.1/std/index.html" title="mod std"><code>std</code></a> itself: so, e.g., the <code>option</code> module in
Rayon contains parallel iterators for the <code>Option</code> type, which is
found in <a href="https://doc.rust-lang.org/1.93.1/core/option/index.html" title="mod core::option">the <code>option</code> module of <code>std</code></a>. Similarly, the
<code>collections</code> module in Rayon offers parallel iterator types for
<a href="https://doc.rust-lang.org/1.93.1/std/collections/index.html" title="mod std::collections">the <code>collections</code> from <code>std</code></a>. You will rarely need to access
these submodules unless you need to name iterator types
explicitly.</p>
<h2 id="targets-without-threading"><a class="doc-anchor" href="#targets-without-threading">§</a>Targets without threading</h2>
<p>Rayon has limited support for targets without <code>std</code> threading implementations.
See the <a href="../rayon_core/index.html" title="mod rayon_core"><code>rayon_core</code></a> documentation for more information about its global fallback.</p>
<h2 id="other-questions"><a class="doc-anchor" href="#other-questions">§</a>Other questions?</h2>
<p>See <a href="https://github.com/rayon-rs/rayon/blob/main/FAQ.md">the Rayon FAQ</a>.</p>
</div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="array/index.html" title="mod rayon::array">array</a></dt><dd>Parallel iterator types for <a href="https://doc.rust-lang.org/1.93.1/std/primitive.array.html" title="primitive array">arrays</a> (<code>[T; N]</code>)</dd><dt><a class="mod" href="collections/index.html" title="mod rayon::collections">collections</a></dt><dd>Parallel iterator types for <a href="https://doc.rust-lang.org/1.93.1/std/collections/index.html" title="mod std::collections">standard collections</a></dd><dt><a class="mod" href="iter/index.html" title="mod rayon::iter">iter</a></dt><dd>Traits for writing parallel programs using an iterator-style interface</dd><dt><a class="mod" href="option/index.html" title="mod rayon::option">option</a></dt><dd>Parallel iterator types for <a href="https://doc.rust-lang.org/1.93.1/core/option/index.html" title="mod core::option">options</a></dd><dt><a class="mod" href="prelude/index.html" title="mod rayon::prelude">prelude</a></dt><dd>The rayon prelude imports the various <code>ParallelIterator</code> traits.
The intention is that one can include <code>use rayon::prelude::*</code> and
have easy access to the various traits and methods you will need.</dd><dt><a class="mod" href="range/index.html" title="mod rayon::range">range</a></dt><dd>Parallel iterator types for <a href="https://doc.rust-lang.org/1.93.1/core/ops/range/struct.Range.html" title="struct core::ops::range::Range">ranges</a>,
the type for values created by <code>a..b</code> expressions</dd><dt><a class="mod" href="range_inclusive/index.html" title="mod rayon::range_inclusive">range_<wbr>inclusive</a></dt><dd>Parallel iterator types for <a href="https://doc.rust-lang.org/1.93.1/core/ops/range/struct.RangeInclusive.html" title="struct core::ops::range::RangeInclusive">inclusive ranges</a>,
the type for values created by <code>a..=b</code> expressions</dd><dt><a class="mod" href="result/index.html" title="mod rayon::result">result</a></dt><dd>Parallel iterator types for <a href="https://doc.rust-lang.org/1.93.1/core/result/index.html" title="mod core::result">results</a></dd><dt><a class="mod" href="slice/index.html" title="mod rayon::slice">slice</a></dt><dd>Parallel iterator types for <a href="https://doc.rust-lang.org/1.93.1/alloc/slice/index.html" title="mod alloc::slice">slices</a></dd><dt><a class="mod" href="str/index.html" title="mod rayon::str">str</a></dt><dd>Parallel iterator types for <a href="https://doc.rust-lang.org/1.93.1/alloc/str/index.html" title="mod alloc::str">strings</a></dd><dt><a class="mod" href="string/index.html" title="mod rayon::string">string</a></dt><dd>This module contains the parallel iterator types for owned strings
(<code>String</code>). You will rarely need to interact with it directly
unless you have need to name one of the iterator types.</dd><dt><a class="mod" href="vec/index.html" title="mod rayon::vec">vec</a></dt><dd>Parallel iterator types for <a href="https://doc.rust-lang.org/1.93.1/alloc/vec/index.html" title="mod alloc::vec">vectors</a> (<code>Vec&lt;T&gt;</code>)</dd></dl><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::BroadcastContext">Broadcast<wbr>Context</a></dt><dd>Provides context to a closure called by <code>broadcast</code>.</dd><dt><a class="struct" href="struct.FnContext.html" title="struct rayon::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::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::scope"><code>scope()</code></a> for more information.</dd><dt><a class="struct" href="struct.ScopeFifo.html" title="struct rayon::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::scope_fifo"><code>scope_fifo()</code></a> for more information.</dd><dt><a class="struct" href="struct.ThreadBuilder.html" title="struct rayon::ThreadBuilder">Thread<wbr>Builder</a></dt><dd>Thread builder used for customization via <a href="struct.ThreadPoolBuilder.html#method.spawn_handler" title="method rayon::ThreadPoolBuilder::spawn_handler"><code>ThreadPoolBuilder::spawn_handler()</code></a>.</dd><dt><a class="struct" href="struct.ThreadPool.html" title="struct rayon::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::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::ThreadPoolBuilder">Thread<wbr>Pool<wbr>Builder</a></dt><dd>Used to create a new <a href="struct.ThreadPool.html" title="struct rayon::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::Yield">Yield</a></dt><dd>Result of <a href="fn.yield_now.html" title="fn rayon::yield_now"><code>yield_now()</code></a> or <a href="fn.yield_local.html" title="fn rayon::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::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::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_index.html" title="fn rayon::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::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::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.join.html" title="fn rayon::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::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::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::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::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::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::scope">the <code>scope()</code>
function</a> to create a scope.</dd><dt><a class="fn" href="fn.spawn_broadcast.html" title="fn rayon::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::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::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::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::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/iter/struct.ExponentialBlocks.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rayon/iter/struct.ExponentialBlocks.html">../../../rayon/iter/struct.ExponentialBlocks.html</a>...</p>
<script>location.replace("../../../rayon/iter/struct.ExponentialBlocks.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/iter/struct.UniformBlocks.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rayon/iter/struct.UniformBlocks.html">../../../rayon/iter/struct.UniformBlocks.html</a>...</p>
<script>location.replace("../../../rayon/iter/struct.UniformBlocks.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/iter/struct.Chain.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rayon/iter/struct.Chain.html">../../../rayon/iter/struct.Chain.html</a>...</p>
<script>location.replace("../../../rayon/iter/struct.Chain.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/iter/struct.Chunks.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rayon/iter/struct.Chunks.html">../../../rayon/iter/struct.Chunks.html</a>...</p>
<script>location.replace("../../../rayon/iter/struct.Chunks.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/iter/struct.Cloned.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rayon/iter/struct.Cloned.html">../../../rayon/iter/struct.Cloned.html</a>...</p>
<script>location.replace("../../../rayon/iter/struct.Cloned.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/iter/struct.Copied.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rayon/iter/struct.Copied.html">../../../rayon/iter/struct.Copied.html</a>...</p>
<script>location.replace("../../../rayon/iter/struct.Copied.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/iter/fn.empty.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rayon/iter/fn.empty.html">../../../rayon/iter/fn.empty.html</a>...</p>
<script>location.replace("../../../rayon/iter/fn.empty.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/iter/struct.Empty.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rayon/iter/struct.Empty.html">../../../rayon/iter/struct.Empty.html</a>...</p>
<script>location.replace("../../../rayon/iter/struct.Empty.html" + location.search + location.hash);</script>
</body>
</html>

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/iter/struct.Enumerate.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rayon/iter/struct.Enumerate.html">../../../rayon/iter/struct.Enumerate.html</a>...</p>
<script>location.replace("../../../rayon/iter/struct.Enumerate.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/iter/struct.Filter.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rayon/iter/struct.Filter.html">../../../rayon/iter/struct.Filter.html</a>...</p>
<script>location.replace("../../../rayon/iter/struct.Filter.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/iter/struct.FilterMap.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rayon/iter/struct.FilterMap.html">../../../rayon/iter/struct.FilterMap.html</a>...</p>
<script>location.replace("../../../rayon/iter/struct.FilterMap.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/iter/struct.FlatMap.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rayon/iter/struct.FlatMap.html">../../../rayon/iter/struct.FlatMap.html</a>...</p>
<script>location.replace("../../../rayon/iter/struct.FlatMap.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/iter/struct.FlatMapIter.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rayon/iter/struct.FlatMapIter.html">../../../rayon/iter/struct.FlatMapIter.html</a>...</p>
<script>location.replace("../../../rayon/iter/struct.FlatMapIter.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/iter/struct.Flatten.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rayon/iter/struct.Flatten.html">../../../rayon/iter/struct.Flatten.html</a>...</p>
<script>location.replace("../../../rayon/iter/struct.Flatten.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/iter/struct.FlattenIter.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rayon/iter/struct.FlattenIter.html">../../../rayon/iter/struct.FlattenIter.html</a>...</p>
<script>location.replace("../../../rayon/iter/struct.FlattenIter.html" + location.search + location.hash);</script>
</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="Creates a parallel iterator that produces nothing."><title>empty in rayon::iter - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="rayon" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc 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="#">empty</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../rayon/index.html">rayon</a><span class="version">1.11.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">empty</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In rayon::<wbr>iter</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">rayon</a>::<wbr><a href="index.html">iter</a></div><h1>Function <span class="fn">empty</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/iter/empty.rs.html#24-28">Source</a> </span></div><pre class="rust item-decl"><code>pub fn empty&lt;T: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>&gt;() -&gt; <a class="struct" href="struct.Empty.html" title="struct rayon::iter::Empty">Empty</a>&lt;T&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Creates a parallel iterator that produces nothing.</p>
<p>This admits no parallelism on its own, but it could be used for code that
deals with generic parallel iterators.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>rayon::prelude::<span class="kw-2">*</span>;
<span class="kw">use </span>rayon::iter::empty;
<span class="kw">let </span>pi = (<span class="number">0</span>..<span class="number">1234</span>).into_par_iter()
.chain(empty())
.chain(<span class="number">1234</span>..<span class="number">10_000</span>);
<span class="macro">assert_eq!</span>(pi.count(), <span class="number">10_000</span>);</code></pre></div></div></details></section></div></main></body></html>

View File

@@ -0,0 +1,15 @@
<!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 parallel iterator that produces an element exactly once."><title>once in rayon::iter - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="rayon" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc 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="#">once</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../rayon/index.html">rayon</a><span class="version">1.11.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">once</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In rayon::<wbr>iter</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">rayon</a>::<wbr><a href="index.html">iter</a></div><h1>Function <span class="fn">once</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/iter/once.rs.html#24-26">Source</a> </span></div><pre class="rust item-decl"><code>pub fn once&lt;T: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>&gt;(item: T) -&gt; <a class="struct" href="struct.Once.html" title="struct rayon::iter::Once">Once</a>&lt;T&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Creates a parallel iterator that produces an element exactly once.</p>
<p>This admits no parallelism on its own, but it could be chained to existing
parallel iterators to extend their contents, or otherwise used for any code
that deals with generic parallel iterators.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>rayon::prelude::<span class="kw-2">*</span>;
<span class="kw">use </span>rayon::iter::once;
<span class="kw">let </span>pi = (<span class="number">0</span>..<span class="number">1234</span>).into_par_iter()
.chain(once(-<span class="number">1</span>))
.chain(<span class="number">1234</span>..<span class="number">10_000</span>);
<span class="macro">assert_eq!</span>(pi.clone().count(), <span class="number">10_001</span>);
<span class="macro">assert_eq!</span>(pi.clone().filter(|<span class="kw-2">&amp;</span>x| x &lt; <span class="number">0</span>).count(), <span class="number">1</span>);
<span class="macro">assert_eq!</span>(pi.position_any(|x| x &lt; <span class="number">0</span>), <span class="prelude-val">Some</span>(<span class="number">1234</span>));</code></pre></div></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="Creates a parallel iterator that endlessly repeats `element` (by cloning it). Note that this iterator has “infinite” length, so typically you would want to use `zip` or `take` or some other means to shorten it, or consider using the `repeat_n()` function instead."><title>repeat in rayon::iter - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="rayon" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc 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="#">repeat</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../rayon/index.html">rayon</a><span class="version">1.11.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">repeat</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In rayon::<wbr>iter</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">rayon</a>::<wbr><a href="index.html">iter</a></div><h1>Function <span class="fn">repeat</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/iter/repeat.rs.html#30-32">Source</a> </span></div><pre class="rust item-decl"><code>pub fn repeat&lt;T: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</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>&gt;(element: T) -&gt; <a class="struct" href="struct.Repeat.html" title="struct rayon::iter::Repeat">Repeat</a>&lt;T&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Creates a parallel iterator that endlessly repeats <code>element</code> (by
cloning it). Note that this iterator has “infinite” length, so
typically you would want to use <code>zip</code> or <code>take</code> or some other
means to shorten it, or consider using
<a href="fn.repeat_n.html" title="fn rayon::iter::repeat_n">the <code>repeat_n()</code> function</a> instead.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>rayon::prelude::<span class="kw-2">*</span>;
<span class="kw">use </span>rayon::iter::repeat;
<span class="kw">let </span>x: Vec&lt;(i32, i32)&gt; = repeat(<span class="number">22</span>).zip(<span class="number">0</span>..<span class="number">3</span>).collect();
<span class="macro">assert_eq!</span>(x, <span class="macro">vec!</span>[(<span class="number">22</span>, <span class="number">0</span>), (<span class="number">22</span>, <span class="number">1</span>), (<span class="number">22</span>, <span class="number">2</span>)]);</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="Creates a parallel iterator that produces `n` repeats of `element` (by cloning it)."><title>repeat_n in rayon::iter - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="rayon" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc 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="#">repeat_n</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../rayon/index.html">rayon</a><span class="version">1.11.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">repeat_<wbr>n</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In rayon::<wbr>iter</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">rayon</a>::<wbr><a href="index.html">iter</a></div><h1>Function <span class="fn">repeat_<wbr>n</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/iter/repeat.rs.html#126-132">Source</a> </span></div><pre class="rust item-decl"><code>pub fn repeat_n&lt;T: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</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>&gt;(element: T, n: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -&gt; <a class="struct" href="struct.RepeatN.html" title="struct rayon::iter::RepeatN">RepeatN</a>&lt;T&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Creates a parallel iterator that produces <code>n</code> repeats of <code>element</code>
(by cloning it).</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>rayon::prelude::<span class="kw-2">*</span>;
<span class="kw">use </span>rayon::iter::repeat_n;
<span class="kw">let </span>x: Vec&lt;(i32, i32)&gt; = repeat_n(<span class="number">22</span>, <span class="number">3</span>).zip(<span class="number">0</span>..<span class="number">3</span>).collect();
<span class="macro">assert_eq!</span>(x, <span class="macro">vec!</span>[(<span class="number">22</span>, <span class="number">0</span>), (<span class="number">22</span>, <span class="number">1</span>), (<span class="number">22</span>, <span class="number">2</span>)]);</code></pre></div></div></details></section></div></main></body></html>

View File

@@ -0,0 +1,4 @@
<!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 parallel iterator that produces `n` repeats of `element` (by cloning it)."><title>repeatn in rayon::iter - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="rayon" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc 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="#">repeatn</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../rayon/index.html">rayon</a><span class="version">1.11.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In rayon::<wbr>iter</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">rayon</a>::<wbr><a href="index.html">iter</a></div><h1>Function <span class="fn">repeatn</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/iter/repeat.rs.html#139-141">Source</a> </span></div><pre class="rust item-decl"><code>pub fn repeatn&lt;T: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</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>&gt;(element: T, n: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -&gt; <a class="struct" href="struct.RepeatN.html" title="struct rayon::iter::RepeatN">RepeatN</a>&lt;T&gt;</code></pre><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated: use <code>repeat_n</code></span></div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Creates a parallel iterator that produces <code>n</code> repeats of <code>element</code>
(by cloning it).</p>
<p>Deprecated in favor of <a href="fn.repeat_n.html" title="fn rayon::iter::repeat_n"><code>repeat_n</code></a> for consistency with the standard library.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,84 @@
<!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="The `split` function takes arbitrary data and a closure that knows how to split it, and turns this into a `ParallelIterator`."><title>split in rayon::iter - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="rayon" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc 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="#">split</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../rayon/index.html">rayon</a><span class="version">1.11.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">split</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In rayon::<wbr>iter</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">rayon</a>::<wbr><a href="index.html">iter</a></div><h1>Function <span class="fn">split</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/iter/splitter.rs.html#106-112">Source</a> </span></div><pre class="rust item-decl"><code>pub fn split&lt;D, S&gt;(data: D, splitter: S) -&gt; <a class="struct" href="struct.Split.html" title="struct rayon::iter::Split">Split</a>&lt;D, S&gt;<div class="where">where
D: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,
S: <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>(D) -&gt; (D, <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;D&gt;) + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,</div></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The <code>split</code> function takes arbitrary data and a closure that knows how to
split it, and turns this into a <code>ParallelIterator</code>.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<p>As a simple example, Rayon can recursively split ranges of indices</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>rayon::iter;
<span class="kw">use </span>rayon::prelude::<span class="kw-2">*</span>;
<span class="kw">use </span>std::ops::Range;
<span class="comment">// We define a range of indices as follows
</span><span class="kw">type </span>Range1D = Range&lt;usize&gt;;
<span class="comment">// Splitting it in two can be done like this
</span><span class="kw">fn </span>split_range1(r: Range1D) -&gt; (Range1D, <span class="prelude-ty">Option</span>&lt;Range1D&gt;) {
<span class="comment">// We are mathematically unable to split the range if there is only
// one point inside of it, but we could stop splitting before that.
</span><span class="kw">if </span>r.end - r.start &lt;= <span class="number">1 </span>{ <span class="kw">return </span>(r, <span class="prelude-val">None</span>); }
<span class="comment">// Here, our range is considered large enough to be splittable
</span><span class="kw">let </span>midpoint = r.start + (r.end - r.start) / <span class="number">2</span>;
(r.start..midpoint, <span class="prelude-val">Some</span>(midpoint..r.end))
}
<span class="comment">// By using iter::split, Rayon will split the range until it has enough work
// to feed the CPU cores, then give us the resulting sub-ranges
</span>iter::split(<span class="number">0</span>..<span class="number">4096</span>, split_range1).for_each(|sub_range| {
<span class="comment">// As our initial range had a power-of-two size, the final sub-ranges
// should have power-of-two sizes too
</span><span class="macro">assert!</span>((sub_range.end - sub_range.start).is_power_of_two());
});</code></pre></div>
<p>This recursive splitting can be extended to two or three dimensions,
to reproduce a classic “block-wise” parallelization scheme of graphics and
numerical simulations:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="comment">// A two-dimensional range of indices can be built out of two 1D ones
</span><span class="kw">struct </span>Range2D {
<span class="comment">// Range of horizontal indices
</span><span class="kw">pub </span>rx: Range1D,
<span class="comment">// Range of vertical indices
</span><span class="kw">pub </span>ry: Range1D,
}
<span class="comment">// We want to recursively split them by the largest dimension until we have
// enough sub-ranges to feed our mighty multi-core CPU. This function
// carries out one such split.
</span><span class="kw">fn </span>split_range2(r2: Range2D) -&gt; (Range2D, <span class="prelude-ty">Option</span>&lt;Range2D&gt;) {
<span class="comment">// Decide on which axis (horizontal/vertical) the range should be split
</span><span class="kw">let </span>width = r2.rx.end - r2.rx.start;
<span class="kw">let </span>height = r2.ry.end - r2.ry.start;
<span class="kw">if </span>width &gt;= height {
<span class="comment">// This is a wide range, split it on the horizontal axis
</span><span class="kw">let </span>(split_rx, ry) = (split_range1(r2.rx), r2.ry);
<span class="kw">let </span>out1 = Range2D {
rx: split_rx.<span class="number">0</span>,
ry: ry.clone(),
};
<span class="kw">let </span>out2 = split_rx.<span class="number">1</span>.map(|rx| Range2D { rx, ry });
(out1, out2)
} <span class="kw">else </span>{
<span class="comment">// This is a tall range, split it on the vertical axis
</span><span class="kw">let </span>(rx, split_ry) = (r2.rx, split_range1(r2.ry));
<span class="kw">let </span>out1 = Range2D {
rx: rx.clone(),
ry: split_ry.<span class="number">0</span>,
};
<span class="kw">let </span>out2 = split_ry.<span class="number">1</span>.map(|ry| Range2D { rx, ry, });
(out1, out2)
}
}
<span class="comment">// Again, rayon can handle the recursive splitting for us
</span><span class="kw">let </span>range = Range2D { rx: <span class="number">0</span>..<span class="number">800</span>, ry: <span class="number">0</span>..<span class="number">600 </span>};
iter::split(range, split_range2).for_each(|sub_range| {
<span class="comment">// If the sub-ranges were indeed split by the largest dimension, then
// if no dimension was twice larger than the other initially, this
// property will remain true in the final sub-ranges.
</span><span class="kw">let </span>width = sub_range.rx.end - sub_range.rx.start;
<span class="kw">let </span>height = sub_range.ry.end - sub_range.ry.start;
<span class="macro">assert!</span>((width / <span class="number">2 </span>&lt;= height) &amp;&amp; (height / <span class="number">2 </span>&lt;= width));
});</code></pre></div></div></details></section></div></main></body></html>

View File

@@ -0,0 +1,29 @@
<!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="Create a tree like parallel iterator from an initial root node. The `children_of` function should take a node and iterate on all of its child nodes. The best parallelization is obtained when the tree is balanced but we should also be able to handle harder cases."><title>walk_tree in rayon::iter - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="rayon" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc 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="#">walk_tree</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../rayon/index.html">rayon</a><span class="version">1.11.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">walk_<wbr>tree</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#ordering" title="Ordering">Ordering</a></li><li><a href="#example" title="Example">Example</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In rayon::<wbr>iter</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">rayon</a>::<wbr><a href="index.html">iter</a></div><h1>Function <span class="fn">walk_<wbr>tree</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/iter/walk_tree.rs.html#497-508">Source</a> </span></div><pre class="rust item-decl"><code>pub fn walk_tree&lt;S, B, I&gt;(root: S, children_of: B) -&gt; <a class="struct" href="struct.WalkTree.html" title="struct rayon::iter::WalkTree">WalkTree</a>&lt;S, B&gt;<div class="where">where
S: <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.Fn.html" title="trait core::ops::function::Fn">Fn</a>(<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;S</a>) -&gt; I + <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>,
I: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>&lt;Item = S, IntoIter: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/iter/traits/double_ended/trait.DoubleEndedIterator.html" title="trait core::iter::traits::double_ended::DoubleEndedIterator">DoubleEndedIterator</a>&gt;,</div></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Create a tree like parallel iterator from an initial root node.
The <code>children_of</code> function should take a node and iterate on all of its child nodes.
The best parallelization is obtained when the tree is balanced
but we should also be able to handle harder cases.</p>
<h2 id="ordering"><a class="doc-anchor" href="#ordering">§</a>Ordering</h2>
<p>This function does not guarantee any ordering but will
use whatever algorithm is thought to achieve the fastest traversal.
See also <a href="fn.walk_tree_prefix.html" title="fn rayon::iter::walk_tree_prefix"><code>walk_tree_prefix</code></a> which guarantees a
prefix order and <a href="fn.walk_tree_postfix.html" title="fn rayon::iter::walk_tree_postfix"><code>walk_tree_postfix</code></a> which guarantees a postfix order.</p>
<h2 id="example"><a class="doc-anchor" href="#example">§</a>Example</h2><div class="example-wrap"><pre class="language-text"><code> 4
/ \
/ \
2 3
/ \
1 2</code></pre></div>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>rayon::iter::walk_tree;
<span class="kw">use </span>rayon::prelude::<span class="kw-2">*</span>;
<span class="kw">let </span>par_iter = walk_tree(<span class="number">4</span>, |<span class="kw-2">&amp;</span>e| {
<span class="kw">if </span>e &lt;= <span class="number">2 </span>{
Vec::new()
} <span class="kw">else </span>{
<span class="macro">vec!</span>[e / <span class="number">2</span>, e / <span class="number">2 </span>+ <span class="number">1</span>]
}
});
<span class="macro">assert_eq!</span>(par_iter.sum::&lt;u32&gt;(), <span class="number">12</span>);</code></pre></div></div></details></section></div></main></body></html>

View File

@@ -0,0 +1,88 @@
<!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="Create a tree like postfix parallel iterator from an initial root node. The `children_of` function should take a node and iterate on all of its child nodes. The best parallelization is obtained when the tree is balanced but we should also be able to handle harder cases."><title>walk_tree_postfix in rayon::iter - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="rayon" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc 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="#">walk_tree_postfix</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../rayon/index.html">rayon</a><span class="version">1.11.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">walk_<wbr>tree_<wbr>postfix</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#ordering" title="Ordering">Ordering</a></li><li><a href="#example" title="Example">Example</a></li><li><a href="#example-1" title="Example">Example</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In rayon::<wbr>iter</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">rayon</a>::<wbr><a href="index.html">iter</a></div><h1>Function <span class="fn">walk_<wbr>tree_<wbr>postfix</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/iter/walk_tree.rs.html#444-454">Source</a> </span></div><pre class="rust item-decl"><code>pub fn walk_tree_postfix&lt;S, B, I&gt;(
root: S,
children_of: B,
) -&gt; <a class="struct" href="struct.WalkTreePostfix.html" title="struct rayon::iter::WalkTreePostfix">WalkTreePostfix</a>&lt;S, B&gt;<div class="where">where
S: <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.Fn.html" title="trait core::ops::function::Fn">Fn</a>(<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;S</a>) -&gt; I + <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>,
I: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>&lt;Item = S&gt;,</div></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Create a tree like postfix parallel iterator from an initial root node.
The <code>children_of</code> function should take a node and iterate on all of its child nodes.
The best parallelization is obtained when the tree is balanced
but we should also be able to handle harder cases.</p>
<h2 id="ordering"><a class="doc-anchor" href="#ordering">§</a>Ordering</h2>
<p>This function guarantees a postfix ordering. See also <a href="fn.walk_tree_prefix.html" title="fn rayon::iter::walk_tree_prefix"><code>walk_tree_prefix</code></a> which guarantees a
prefix order. If you dont care about ordering, you should use <a href="fn.walk_tree.html" title="fn rayon::iter::walk_tree"><code>walk_tree</code></a>, which will use
whatever is believed to be fastest.</p>
<p>Between siblings, children are reduced in order that is first children are reduced first.</p>
<p>For example a perfect binary tree of 7 nodes will reduced in the following order:</p>
<div class="example-wrap"><pre class="language-text"><code> a
/ \
/ \
b c
/ \ / \
d e f g
reduced as d,e,b,f,g,c,a
</code></pre></div><h2 id="example"><a class="doc-anchor" href="#example">§</a>Example</h2><div class="example-wrap"><pre class="language-text"><code> 4
/ \
/ \
2 3
/ \
1 2</code></pre></div>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>rayon::iter::walk_tree_postfix;
<span class="kw">use </span>rayon::prelude::<span class="kw-2">*</span>;
<span class="kw">let </span>par_iter = walk_tree_postfix(<span class="number">4</span>, |<span class="kw-2">&amp;</span>e| {
<span class="kw">if </span>e &lt;= <span class="number">2 </span>{
Vec::new()
} <span class="kw">else </span>{
<span class="macro">vec!</span>[e / <span class="number">2</span>, e / <span class="number">2 </span>+ <span class="number">1</span>]
}
});
<span class="macro">assert_eq!</span>(par_iter.sum::&lt;u32&gt;(), <span class="number">12</span>);</code></pre></div><h2 id="example-1"><a class="doc-anchor" href="#example-1">§</a>Example</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>rayon::prelude::<span class="kw-2">*</span>;
<span class="kw">use </span>rayon::iter::walk_tree_postfix;
<span class="kw">struct </span>Node {
content: u32,
left: <span class="prelude-ty">Option</span>&lt;Box&lt;Node&gt;&gt;,
right: <span class="prelude-ty">Option</span>&lt;Box&lt;Node&gt;&gt;,
}
<span class="comment">// Here we loop on the following tree:
//
// 10
// / \
// / \
// 3 14
// \
// \
// 18
</span><span class="kw">let </span>root = Node {
content: <span class="number">10</span>,
left: <span class="prelude-val">Some</span>(Box::new(Node {
content: <span class="number">3</span>,
left: <span class="prelude-val">None</span>,
right: <span class="prelude-val">None</span>,
})),
right: <span class="prelude-val">Some</span>(Box::new(Node {
content: <span class="number">14</span>,
left: <span class="prelude-val">None</span>,
right: <span class="prelude-val">Some</span>(Box::new(Node {
content: <span class="number">18</span>,
left: <span class="prelude-val">None</span>,
right: <span class="prelude-val">None</span>,
})),
})),
};
<span class="kw">let </span><span class="kw-2">mut </span>v: Vec&lt;u32&gt; = walk_tree_postfix(<span class="kw-2">&amp;</span>root, |r| {
r.left
.as_ref()
.into_iter()
.chain(r.right.as_ref())
.map(|n| <span class="kw-2">&amp;**</span>n)
})
.map(|node| node.content)
.collect();
<span class="macro">assert_eq!</span>(v, <span class="macro">vec!</span>[<span class="number">3</span>, <span class="number">18</span>, <span class="number">14</span>, <span class="number">10</span>]);</code></pre></div></div></details></section></div></main></body></html>

View File

@@ -0,0 +1,88 @@
<!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="Create a tree-like prefix parallel iterator from an initial root node. The `children_of` function should take a node and return an iterator over its child nodes. The best parallelization is obtained when the tree is balanced but we should also be able to handle harder cases."><title>walk_tree_prefix in rayon::iter - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="rayon" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc 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="#">walk_tree_prefix</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../rayon/index.html">rayon</a><span class="version">1.11.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">walk_<wbr>tree_<wbr>prefix</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#ordering" title="Ordering">Ordering</a></li><li><a href="#example" title="Example">Example</a></li><li><a href="#example-1" title="Example">Example</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In rayon::<wbr>iter</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">rayon</a>::<wbr><a href="index.html">iter</a></div><h1>Function <span class="fn">walk_<wbr>tree_<wbr>prefix</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/iter/walk_tree.rs.html#204-214">Source</a> </span></div><pre class="rust item-decl"><code>pub fn walk_tree_prefix&lt;S, B, I&gt;(
root: S,
children_of: B,
) -&gt; <a class="struct" href="struct.WalkTreePrefix.html" title="struct rayon::iter::WalkTreePrefix">WalkTreePrefix</a>&lt;S, B&gt;<div class="where">where
S: <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.Fn.html" title="trait core::ops::function::Fn">Fn</a>(<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;S</a>) -&gt; I + <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>,
I: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>&lt;Item = S, IntoIter: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/iter/traits/double_ended/trait.DoubleEndedIterator.html" title="trait core::iter::traits::double_ended::DoubleEndedIterator">DoubleEndedIterator</a>&gt;,</div></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Create a tree-like prefix parallel iterator from an initial root node.
The <code>children_of</code> function should take a node and return an iterator over its child nodes.
The best parallelization is obtained when the tree is balanced
but we should also be able to handle harder cases.</p>
<h2 id="ordering"><a class="doc-anchor" href="#ordering">§</a>Ordering</h2>
<p>This function guarantees a prefix ordering. See also <a href="fn.walk_tree_postfix.html" title="fn rayon::iter::walk_tree_postfix"><code>walk_tree_postfix</code></a>,
which guarantees a postfix order.
If you dont care about ordering, you should use <a href="fn.walk_tree.html" title="fn rayon::iter::walk_tree"><code>walk_tree</code></a>,
which will use whatever is believed to be fastest.
For example a perfect binary tree of 7 nodes will reduced in the following order:</p>
<div class="example-wrap"><pre class="language-text"><code> a
/ \
/ \
b c
/ \ / \
d e f g
reduced as a,b,d,e,c,f,g
</code></pre></div><h2 id="example"><a class="doc-anchor" href="#example">§</a>Example</h2><div class="example-wrap"><pre class="language-text"><code> 4
/ \
/ \
2 3
/ \
1 2</code></pre></div>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>rayon::iter::walk_tree_prefix;
<span class="kw">use </span>rayon::prelude::<span class="kw-2">*</span>;
<span class="kw">let </span>par_iter = walk_tree_prefix(<span class="number">4</span>, |<span class="kw-2">&amp;</span>e| {
<span class="kw">if </span>e &lt;= <span class="number">2 </span>{
Vec::new()
} <span class="kw">else </span>{
<span class="macro">vec!</span>[e / <span class="number">2</span>, e / <span class="number">2 </span>+ <span class="number">1</span>]
}
});
<span class="macro">assert_eq!</span>(par_iter.sum::&lt;u32&gt;(), <span class="number">12</span>);</code></pre></div><h2 id="example-1"><a class="doc-anchor" href="#example-1">§</a>Example</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>rayon::prelude::<span class="kw-2">*</span>;
<span class="kw">use </span>rayon::iter::walk_tree_prefix;
<span class="kw">struct </span>Node {
content: u32,
left: <span class="prelude-ty">Option</span>&lt;Box&lt;Node&gt;&gt;,
right: <span class="prelude-ty">Option</span>&lt;Box&lt;Node&gt;&gt;,
}
<span class="comment">// Here we loop on the following tree:
//
// 10
// / \
// / \
// 3 14
// \
// \
// 18
</span><span class="kw">let </span>root = Node {
content: <span class="number">10</span>,
left: <span class="prelude-val">Some</span>(Box::new(Node {
content: <span class="number">3</span>,
left: <span class="prelude-val">None</span>,
right: <span class="prelude-val">None</span>,
})),
right: <span class="prelude-val">Some</span>(Box::new(Node {
content: <span class="number">14</span>,
left: <span class="prelude-val">None</span>,
right: <span class="prelude-val">Some</span>(Box::new(Node {
content: <span class="number">18</span>,
left: <span class="prelude-val">None</span>,
right: <span class="prelude-val">None</span>,
})),
})),
};
<span class="kw">let </span><span class="kw-2">mut </span>v: Vec&lt;u32&gt; = walk_tree_prefix(<span class="kw-2">&amp;</span>root, |r| {
r.left
.as_ref()
.into_iter()
.chain(r.right.as_ref())
.map(|n| <span class="kw-2">&amp;**</span>n)
})
.map(|node| node.content)
.collect();
<span class="macro">assert_eq!</span>(v, <span class="macro">vec!</span>[<span class="number">10</span>, <span class="number">3</span>, <span class="number">14</span>, <span class="number">18</span>]);</code></pre></div></div></details></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/iter/struct.Fold.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rayon/iter/struct.Fold.html">../../../rayon/iter/struct.Fold.html</a>...</p>
<script>location.replace("../../../rayon/iter/struct.Fold.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/iter/struct.FoldWith.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rayon/iter/struct.FoldWith.html">../../../rayon/iter/struct.FoldWith.html</a>...</p>
<script>location.replace("../../../rayon/iter/struct.FoldWith.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/iter/struct.FoldChunks.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rayon/iter/struct.FoldChunks.html">../../../rayon/iter/struct.FoldChunks.html</a>...</p>
<script>location.replace("../../../rayon/iter/struct.FoldChunks.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/iter/struct.FoldChunksWith.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rayon/iter/struct.FoldChunksWith.html">../../../rayon/iter/struct.FoldChunksWith.html</a>...</p>
<script>location.replace("../../../rayon/iter/struct.FoldChunksWith.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,133 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Traits for writing parallel programs using an iterator-style interface"><title>rayon::iter - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="rayon" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[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="#">Module iter</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../rayon/index.html">rayon</a><span class="version">1.11.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module iter</a></h2><h3><a href="#modules">Module Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#traits" title="Traits">Traits</a></li><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate rayon</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">rayon</a></div><h1>Module <span>iter</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/iter/mod.rs.html#1-3627">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Traits for writing parallel programs using an iterator-style interface</p>
<p>You will rarely need to interact with this module directly unless you have
need to name one of the iterator types.</p>
<p>Parallel iterators make it easy to write iterator-like chains that
execute in parallel: typically all you have to do is convert the
first <code>.iter()</code> (or <code>iter_mut()</code>, <code>into_iter()</code>, etc) method into
<code>par_iter()</code> (or <code>par_iter_mut()</code>, <code>into_par_iter()</code>, etc). For
example, to compute the sum of the squares of a sequence of
integers, one might write:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>rayon::prelude::<span class="kw-2">*</span>;
<span class="kw">fn </span>sum_of_squares(input: <span class="kw-2">&amp;</span>[i32]) -&gt; i32 {
input.par_iter()
.map(|i| i * i)
.sum()
}</code></pre></div>
<p>Or, to increment all the integers in a slice, you could write:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>rayon::prelude::<span class="kw-2">*</span>;
<span class="kw">fn </span>increment_all(input: <span class="kw-2">&amp;mut </span>[i32]) {
input.par_iter_mut()
.for_each(|p| <span class="kw-2">*</span>p += <span class="number">1</span>);
}</code></pre></div>
<p>To use parallel iterators, first import the traits by adding
something like <code>use rayon::prelude::*</code> to your module. You can
then call <code>par_iter</code>, <code>par_iter_mut</code>, or <code>into_par_iter</code> to get a
parallel iterator. Like a <a href="https://doc.rust-lang.org/1.93.1/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">regular iterator</a>, parallel
iterators work by first constructing a computation and then
executing it.</p>
<p>In addition to <code>par_iter()</code> and friends, some types offer other
ways to create (or consume) parallel iterators:</p>
<ul>
<li>Slices (<code>&amp;[T]</code>, <code>&amp;mut [T]</code>) offer methods like <code>par_split</code> and
<code>par_windows</code>, as well as various parallel sorting
operations. See <a href="../slice/trait.ParallelSlice.html" title="trait rayon::slice::ParallelSlice">the <code>ParallelSlice</code> trait</a> for the full list.</li>
<li>Strings (<code>&amp;str</code>) offer methods like <code>par_split</code> and <code>par_lines</code>.
See <a href="../str/trait.ParallelString.html" title="trait rayon::str::ParallelString">the <code>ParallelString</code> trait</a> for the full list.</li>
<li>Various collections offer <a href="trait.ParallelExtend.html" title="trait rayon::iter::ParallelExtend"><code>par_extend</code></a>, which grows a
collection given a parallel iterator. (If you dont have a
collection to extend, you can use <a href="trait.ParallelIterator.html#method.collect" title="method rayon::iter::ParallelIterator::collect"><code>collect()</code></a> to create a new
one from scratch.)</li>
</ul>
<p>To see the full range of methods available on parallel iterators,
check out the <a href="trait.ParallelIterator.html" title="trait rayon::iter::ParallelIterator"><code>ParallelIterator</code></a> and <a href="trait.IndexedParallelIterator.html" title="trait rayon::iter::IndexedParallelIterator"><code>IndexedParallelIterator</code></a>
traits.</p>
<p>If youd like to build a custom parallel iterator, or to write your own
combinator, then check out the <a href="fn.split.html" title="fn rayon::iter::split">split</a> function and the <a href="plumbing/index.html" title="mod rayon::iter::plumbing">plumbing</a> module.</p>
<p>Note: Several of the <code>ParallelIterator</code> methods rely on a <code>Try</code> trait which
has been deliberately obscured from the public API. This trait is intended
to mirror the unstable <code>std::ops::Try</code> with implementations for <code>Option</code> and
<code>Result</code>, where <code>Some</code>/<code>Ok</code> values will let those iterators continue, but
<code>None</code>/<code>Err</code> values will exit early.</p>
<p>A note about object safety: It is currently <em>not</em> possible to wrap
a <code>ParallelIterator</code> (or any trait that depends on it) using a
<code>Box&lt;dyn ParallelIterator&gt;</code> or other kind of dynamic allocation,
because <code>ParallelIterator</code> is <strong>not object-safe</strong>.
(This keeps the implementation simpler and allows extra optimizations.)</p>
</div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="plumbing/index.html" title="mod rayon::iter::plumbing">plumbing</a></dt><dd>Traits and functions used to implement parallel iteration. These are
low-level details users of parallel iterators should not need to
interact with them directly. See <a href="https://github.com/rayon-rs/rayon/blob/main/src/iter/plumbing/README.md">the <code>plumbing</code> README</a> for a general overview.</dd></dl><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.Chain.html" title="struct rayon::iter::Chain">Chain</a></dt><dd><code>Chain</code> is an iterator that joins <code>b</code> after <code>a</code> in one continuous iterator.
This struct is created by the <a href="trait.ParallelIterator.html#method.chain" title="method rayon::iter::ParallelIterator::chain"><code>chain()</code></a> method on <a href="trait.ParallelIterator.html" title="trait rayon::iter::ParallelIterator"><code>ParallelIterator</code></a></dd><dt><a class="struct" href="struct.Chunks.html" title="struct rayon::iter::Chunks">Chunks</a></dt><dd><code>Chunks</code> is an iterator that groups elements of an underlying iterator.</dd><dt><a class="struct" href="struct.Cloned.html" title="struct rayon::iter::Cloned">Cloned</a></dt><dd><code>Cloned</code> is an iterator that clones the elements of an underlying iterator.</dd><dt><a class="struct" href="struct.Copied.html" title="struct rayon::iter::Copied">Copied</a></dt><dd><code>Copied</code> is an iterator that copies the elements of an underlying iterator.</dd><dt><a class="struct" href="struct.Empty.html" title="struct rayon::iter::Empty">Empty</a></dt><dd>Iterator adaptor for <a href="fn.empty.html" title="fn rayon::iter::empty">the <code>empty()</code> function</a>.</dd><dt><a class="struct" href="struct.Enumerate.html" title="struct rayon::iter::Enumerate">Enumerate</a></dt><dd><code>Enumerate</code> is an iterator that returns the current count along with the element.
This struct is created by the <a href="trait.IndexedParallelIterator.html#method.enumerate" title="method rayon::iter::IndexedParallelIterator::enumerate"><code>enumerate()</code></a> method on <a href="trait.IndexedParallelIterator.html" title="trait rayon::iter::IndexedParallelIterator"><code>IndexedParallelIterator</code></a></dd><dt><a class="struct" href="struct.ExponentialBlocks.html" title="struct rayon::iter::ExponentialBlocks">Exponential<wbr>Blocks</a></dt><dd><code>ExponentialBlocks</code> is a parallel iterator that consumes itself as a sequence
of parallel blocks of increasing sizes (exponentially).</dd><dt><a class="struct" href="struct.Filter.html" title="struct rayon::iter::Filter">Filter</a></dt><dd><code>Filter</code> takes a predicate <code>filter_op</code> and filters out elements that match.
This struct is created by the <a href="trait.ParallelIterator.html#method.filter" title="method rayon::iter::ParallelIterator::filter"><code>filter()</code></a> method on <a href="trait.ParallelIterator.html" title="trait rayon::iter::ParallelIterator"><code>ParallelIterator</code></a></dd><dt><a class="struct" href="struct.FilterMap.html" title="struct rayon::iter::FilterMap">Filter<wbr>Map</a></dt><dd><code>FilterMap</code> creates an iterator that uses <code>filter_op</code> to both filter and map elements.
This struct is created by the <a href="trait.ParallelIterator.html#method.filter_map" title="method rayon::iter::ParallelIterator::filter_map"><code>filter_map()</code></a> method on <a href="trait.ParallelIterator.html" title="trait rayon::iter::ParallelIterator"><code>ParallelIterator</code></a>.</dd><dt><a class="struct" href="struct.FlatMap.html" title="struct rayon::iter::FlatMap">FlatMap</a></dt><dd><code>FlatMap</code> maps each element to a parallel iterator, then flattens these iterators together.
This struct is created by the <a href="trait.ParallelIterator.html#method.flat_map" title="method rayon::iter::ParallelIterator::flat_map"><code>flat_map()</code></a> method on <a href="trait.ParallelIterator.html" title="trait rayon::iter::ParallelIterator"><code>ParallelIterator</code></a></dd><dt><a class="struct" href="struct.FlatMapIter.html" title="struct rayon::iter::FlatMapIter">Flat<wbr>MapIter</a></dt><dd><code>FlatMapIter</code> maps each element to a serial iterator, then flattens these iterators together.
This struct is created by the <a href="trait.ParallelIterator.html#method.flat_map_iter" title="method rayon::iter::ParallelIterator::flat_map_iter"><code>flat_map_iter()</code></a> method on <a href="trait.ParallelIterator.html" title="trait rayon::iter::ParallelIterator"><code>ParallelIterator</code></a></dd><dt><a class="struct" href="struct.Flatten.html" title="struct rayon::iter::Flatten">Flatten</a></dt><dd><code>Flatten</code> turns each element to a parallel iterator, then flattens these iterators
together. This struct is created by the <a href="trait.ParallelIterator.html#method.flatten" title="method rayon::iter::ParallelIterator::flatten"><code>flatten()</code></a> method on <a href="trait.ParallelIterator.html" title="trait rayon::iter::ParallelIterator"><code>ParallelIterator</code></a>.</dd><dt><a class="struct" href="struct.FlattenIter.html" title="struct rayon::iter::FlattenIter">Flatten<wbr>Iter</a></dt><dd><code>FlattenIter</code> turns each element to a serial iterator, then flattens these iterators
together. This struct is created by the <a href="trait.ParallelIterator.html#method.flatten_iter" title="method rayon::iter::ParallelIterator::flatten_iter"><code>flatten_iter()</code></a> method on <a href="trait.ParallelIterator.html" title="trait rayon::iter::ParallelIterator"><code>ParallelIterator</code></a>.</dd><dt><a class="struct" href="struct.Fold.html" title="struct rayon::iter::Fold">Fold</a></dt><dd><code>Fold</code> is an iterator that applies a function over an iterator producing a single value.
This struct is created by the <a href="trait.ParallelIterator.html#method.fold" title="method rayon::iter::ParallelIterator::fold"><code>fold()</code></a> method on <a href="trait.ParallelIterator.html" title="trait rayon::iter::ParallelIterator"><code>ParallelIterator</code></a></dd><dt><a class="struct" href="struct.FoldChunks.html" title="struct rayon::iter::FoldChunks">Fold<wbr>Chunks</a></dt><dd><code>FoldChunks</code> is an iterator that groups elements of an underlying iterator and applies a
function over them, producing a single value for each group.</dd><dt><a class="struct" href="struct.FoldChunksWith.html" title="struct rayon::iter::FoldChunksWith">Fold<wbr>Chunks<wbr>With</a></dt><dd><code>FoldChunksWith</code> is an iterator that groups elements of an underlying iterator and applies a
function over them, producing a single value for each group.</dd><dt><a class="struct" href="struct.FoldWith.html" title="struct rayon::iter::FoldWith">Fold<wbr>With</a></dt><dd><code>FoldWith</code> is an iterator that applies a function over an iterator producing a single value.
This struct is created by the <a href="trait.ParallelIterator.html#method.fold_with" title="method rayon::iter::ParallelIterator::fold_with"><code>fold_with()</code></a> method on <a href="trait.ParallelIterator.html" title="trait rayon::iter::ParallelIterator"><code>ParallelIterator</code></a></dd><dt><a class="struct" href="struct.Inspect.html" title="struct rayon::iter::Inspect">Inspect</a></dt><dd><code>Inspect</code> is an iterator that calls a function with a reference to each
element before yielding it.</dd><dt><a class="struct" href="struct.Interleave.html" title="struct rayon::iter::Interleave">Interleave</a></dt><dd><code>Interleave</code> is an iterator that interleaves elements of iterators
<code>i</code> and <code>j</code> in one continuous iterator. This struct is created by
the <a href="trait.IndexedParallelIterator.html#method.interleave" title="method rayon::iter::IndexedParallelIterator::interleave"><code>interleave()</code></a> method on <a href="trait.IndexedParallelIterator.html" title="trait rayon::iter::IndexedParallelIterator"><code>IndexedParallelIterator</code></a></dd><dt><a class="struct" href="struct.InterleaveShortest.html" title="struct rayon::iter::InterleaveShortest">Interleave<wbr>Shortest</a></dt><dd><code>InterleaveShortest</code> is an iterator that works similarly to
<code>Interleave</code>, but this version stops returning elements once one
of the iterators run out.</dd><dt><a class="struct" href="struct.Intersperse.html" title="struct rayon::iter::Intersperse">Intersperse</a></dt><dd><code>Intersperse</code> is an iterator that inserts a particular item between each
item of the adapted iterator. This struct is created by the
<a href="trait.ParallelIterator.html#method.intersperse" title="method rayon::iter::ParallelIterator::intersperse"><code>intersperse()</code></a> method on <a href="trait.ParallelIterator.html" title="trait rayon::iter::ParallelIterator"><code>ParallelIterator</code></a></dd><dt><a class="struct" href="struct.IterBridge.html" title="struct rayon::iter::IterBridge">Iter<wbr>Bridge</a></dt><dd><code>IterBridge</code> is a parallel iterator that wraps a sequential iterator.</dd><dt><a class="struct" href="struct.Map.html" title="struct rayon::iter::Map">Map</a></dt><dd><code>Map</code> is an iterator that transforms the elements of an underlying iterator.</dd><dt><a class="struct" href="struct.MapInit.html" title="struct rayon::iter::MapInit">MapInit</a></dt><dd><code>MapInit</code> is an iterator that transforms the elements of an underlying iterator.</dd><dt><a class="struct" href="struct.MapWith.html" title="struct rayon::iter::MapWith">MapWith</a></dt><dd><code>MapWith</code> is an iterator that transforms the elements of an underlying iterator.</dd><dt><a class="struct" href="struct.MaxLen.html" title="struct rayon::iter::MaxLen">MaxLen</a></dt><dd><code>MaxLen</code> is an iterator that imposes a maximum length on iterator splits.
This struct is created by the <a href="trait.IndexedParallelIterator.html#method.with_max_len" title="method rayon::iter::IndexedParallelIterator::with_max_len"><code>with_max_len()</code></a> method on <a href="trait.IndexedParallelIterator.html" title="trait rayon::iter::IndexedParallelIterator"><code>IndexedParallelIterator</code></a></dd><dt><a class="struct" href="struct.MinLen.html" title="struct rayon::iter::MinLen">MinLen</a></dt><dd><code>MinLen</code> is an iterator that imposes a minimum length on iterator splits.
This struct is created by the <a href="trait.IndexedParallelIterator.html#method.with_min_len" title="method rayon::iter::IndexedParallelIterator::with_min_len"><code>with_min_len()</code></a> method on <a href="trait.IndexedParallelIterator.html" title="trait rayon::iter::IndexedParallelIterator"><code>IndexedParallelIterator</code></a></dd><dt><a class="struct" href="struct.MultiZip.html" title="struct rayon::iter::MultiZip">Multi<wbr>Zip</a></dt><dd><code>MultiZip</code> is an iterator that zips up a tuple of parallel iterators to
produce tuples of their items.</dd><dt><a class="struct" href="struct.Once.html" title="struct rayon::iter::Once">Once</a></dt><dd>Iterator adaptor for <a href="fn.once.html" title="fn rayon::iter::once">the <code>once()</code> function</a>.</dd><dt><a class="struct" href="struct.PanicFuse.html" title="struct rayon::iter::PanicFuse">Panic<wbr>Fuse</a></dt><dd><code>PanicFuse</code> is an adaptor that wraps an iterator with a fuse in case
of panics, to halt all threads as soon as possible.</dd><dt><a class="struct" href="struct.Positions.html" title="struct rayon::iter::Positions">Positions</a></dt><dd><code>Positions</code> takes a predicate <code>predicate</code> and filters out elements that match,
yielding their indices.</dd><dt><a class="struct" href="struct.Repeat.html" title="struct rayon::iter::Repeat">Repeat</a></dt><dd>Iterator adaptor for <a href="fn.repeat.html" title="fn rayon::iter::repeat">the <code>repeat()</code> function</a>.</dd><dt><a class="struct" href="struct.RepeatN.html" title="struct rayon::iter::RepeatN">RepeatN</a></dt><dd>Iterator adaptor for <a href="fn.repeat_n.html" title="fn rayon::iter::repeat_n">the <code>repeat_n()</code> function</a>.</dd><dt><a class="struct" href="struct.Rev.html" title="struct rayon::iter::Rev">Rev</a></dt><dd><code>Rev</code> is an iterator that produces elements in reverse order. This struct
is created by the <a href="trait.IndexedParallelIterator.html#method.rev" title="method rayon::iter::IndexedParallelIterator::rev"><code>rev()</code></a> method on <a href="trait.IndexedParallelIterator.html" title="trait rayon::iter::IndexedParallelIterator"><code>IndexedParallelIterator</code></a></dd><dt><a class="struct" href="struct.Skip.html" title="struct rayon::iter::Skip">Skip</a></dt><dd><code>Skip</code> is an iterator that skips over the first <code>n</code> elements.
This struct is created by the <a href="trait.IndexedParallelIterator.html#method.skip" title="method rayon::iter::IndexedParallelIterator::skip"><code>skip()</code></a> method on <a href="trait.IndexedParallelIterator.html" title="trait rayon::iter::IndexedParallelIterator"><code>IndexedParallelIterator</code></a></dd><dt><a class="struct" href="struct.SkipAny.html" title="struct rayon::iter::SkipAny">SkipAny</a></dt><dd><code>SkipAny</code> is an iterator that skips over <code>n</code> elements from anywhere in <code>I</code>.
This struct is created by the <a href="trait.ParallelIterator.html#method.skip_any" title="method rayon::iter::ParallelIterator::skip_any"><code>skip_any()</code></a> method on <a href="trait.ParallelIterator.html" title="trait rayon::iter::ParallelIterator"><code>ParallelIterator</code></a></dd><dt><a class="struct" href="struct.SkipAnyWhile.html" title="struct rayon::iter::SkipAnyWhile">Skip<wbr>AnyWhile</a></dt><dd><code>SkipAnyWhile</code> is an iterator that skips over elements from anywhere in <code>I</code>
until the callback returns <code>false</code>.
This struct is created by the <a href="trait.ParallelIterator.html#method.skip_any_while" title="method rayon::iter::ParallelIterator::skip_any_while"><code>skip_any_while()</code></a> method on <a href="trait.ParallelIterator.html" title="trait rayon::iter::ParallelIterator"><code>ParallelIterator</code></a></dd><dt><a class="struct" href="struct.Split.html" title="struct rayon::iter::Split">Split</a></dt><dd><code>Split</code> is a parallel iterator using arbitrary data and a splitting function.
This struct is created by the <a href="fn.split.html" title="fn rayon::iter::split"><code>split()</code></a> function.</dd><dt><a class="struct" href="struct.StepBy.html" title="struct rayon::iter::StepBy">StepBy</a></dt><dd><code>StepBy</code> is an iterator that skips <code>n</code> elements between each yield, where <code>n</code> is the given step.
This struct is created by the <a href="trait.IndexedParallelIterator.html#method.step_by" title="method rayon::iter::IndexedParallelIterator::step_by"><code>step_by()</code></a> method on <a href="trait.IndexedParallelIterator.html" title="trait rayon::iter::IndexedParallelIterator"><code>IndexedParallelIterator</code></a></dd><dt><a class="struct" href="struct.Take.html" title="struct rayon::iter::Take">Take</a></dt><dd><code>Take</code> is an iterator that iterates over the first <code>n</code> elements.
This struct is created by the <a href="trait.IndexedParallelIterator.html#method.take" title="method rayon::iter::IndexedParallelIterator::take"><code>take()</code></a> method on <a href="trait.IndexedParallelIterator.html" title="trait rayon::iter::IndexedParallelIterator"><code>IndexedParallelIterator</code></a></dd><dt><a class="struct" href="struct.TakeAny.html" title="struct rayon::iter::TakeAny">TakeAny</a></dt><dd><code>TakeAny</code> is an iterator that iterates over <code>n</code> elements from anywhere in <code>I</code>.
This struct is created by the <a href="trait.ParallelIterator.html#method.take_any" title="method rayon::iter::ParallelIterator::take_any"><code>take_any()</code></a> method on <a href="trait.ParallelIterator.html" title="trait rayon::iter::ParallelIterator"><code>ParallelIterator</code></a></dd><dt><a class="struct" href="struct.TakeAnyWhile.html" title="struct rayon::iter::TakeAnyWhile">Take<wbr>AnyWhile</a></dt><dd><code>TakeAnyWhile</code> is an iterator that iterates over elements from anywhere in <code>I</code>
until the callback returns <code>false</code>.
This struct is created by the <a href="trait.ParallelIterator.html#method.take_any_while" title="method rayon::iter::ParallelIterator::take_any_while"><code>take_any_while()</code></a> method on <a href="trait.ParallelIterator.html" title="trait rayon::iter::ParallelIterator"><code>ParallelIterator</code></a></dd><dt><a class="struct" href="struct.TryFold.html" title="struct rayon::iter::TryFold">TryFold</a></dt><dd><code>TryFold</code> is an iterator that applies a function over an iterator producing a single value.
This struct is created by the <a href="trait.ParallelIterator.html#method.try_fold" title="method rayon::iter::ParallelIterator::try_fold"><code>try_fold()</code></a> method on <a href="trait.ParallelIterator.html" title="trait rayon::iter::ParallelIterator"><code>ParallelIterator</code></a></dd><dt><a class="struct" href="struct.TryFoldWith.html" title="struct rayon::iter::TryFoldWith">TryFold<wbr>With</a></dt><dd><code>TryFoldWith</code> is an iterator that applies a function over an iterator producing a single value.
This struct is created by the <a href="trait.ParallelIterator.html#method.try_fold_with" title="method rayon::iter::ParallelIterator::try_fold_with"><code>try_fold_with()</code></a> method on <a href="trait.ParallelIterator.html" title="trait rayon::iter::ParallelIterator"><code>ParallelIterator</code></a></dd><dt><a class="struct" href="struct.UniformBlocks.html" title="struct rayon::iter::UniformBlocks">Uniform<wbr>Blocks</a></dt><dd><code>UniformBlocks</code> is a parallel iterator that consumes itself as a sequence
of parallel blocks of constant sizes.</dd><dt><a class="struct" href="struct.Update.html" title="struct rayon::iter::Update">Update</a></dt><dd><code>Update</code> is an iterator that mutates the elements of an
underlying iterator before they are yielded.</dd><dt><a class="struct" href="struct.WalkTree.html" title="struct rayon::iter::WalkTree">Walk<wbr>Tree</a></dt><dd>ParallelIterator for arbitrary tree-shaped patterns.
Returned by the <a href="fn.walk_tree.html" title="fn rayon::iter::walk_tree"><code>walk_tree()</code></a> function.</dd><dt><a class="struct" href="struct.WalkTreePostfix.html" title="struct rayon::iter::WalkTreePostfix">Walk<wbr>Tree<wbr>Postfix</a></dt><dd>ParallelIterator for arbitrary tree-shaped patterns.
Returned by the <a href="fn.walk_tree_postfix.html" title="fn rayon::iter::walk_tree_postfix"><code>walk_tree_postfix()</code></a> function.</dd><dt><a class="struct" href="struct.WalkTreePrefix.html" title="struct rayon::iter::WalkTreePrefix">Walk<wbr>Tree<wbr>Prefix</a></dt><dd>ParallelIterator for arbitrary tree-shaped patterns.
Returned by the <a href="fn.walk_tree_prefix.html" title="fn rayon::iter::walk_tree_prefix"><code>walk_tree_prefix()</code></a> function.</dd><dt><a class="struct" href="struct.WhileSome.html" title="struct rayon::iter::WhileSome">While<wbr>Some</a></dt><dd><code>WhileSome</code> is an iterator that yields the <code>Some</code> elements of an iterator,
halting as soon as any <code>None</code> is produced.</dd><dt><a class="struct" href="struct.Zip.html" title="struct rayon::iter::Zip">Zip</a></dt><dd><code>Zip</code> is an iterator that zips up <code>a</code> and <code>b</code> into a single iterator
of pairs. This struct is created by the <a href="trait.IndexedParallelIterator.html#method.zip" title="method rayon::iter::IndexedParallelIterator::zip"><code>zip()</code></a> method on
<a href="trait.IndexedParallelIterator.html" title="trait rayon::iter::IndexedParallelIterator"><code>IndexedParallelIterator</code></a></dd><dt><a class="struct" href="struct.ZipEq.html" title="struct rayon::iter::ZipEq">ZipEq</a></dt><dd>An <a href="trait.IndexedParallelIterator.html" title="trait rayon::iter::IndexedParallelIterator"><code>IndexedParallelIterator</code></a> that iterates over two parallel iterators of equal
length simultaneously.</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.Either.html" title="enum rayon::iter::Either">Either</a></dt><dd>The enum <code>Either</code> with variants <code>Left</code> and <code>Right</code> is a general purpose
sum type with two cases.</dd></dl><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><dl class="item-table"><dt><a class="trait" href="trait.FromParallelIterator.html" title="trait rayon::iter::FromParallelIterator">From<wbr>Parallel<wbr>Iterator</a></dt><dd><code>FromParallelIterator</code> implements the creation of a collection
from a <a href="trait.ParallelIterator.html" title="trait rayon::iter::ParallelIterator"><code>ParallelIterator</code></a>. By implementing
<code>FromParallelIterator</code> for a given type, you define how it will be
created from an iterator.</dd><dt><a class="trait" href="trait.IndexedParallelIterator.html" title="trait rayon::iter::IndexedParallelIterator">Indexed<wbr>Parallel<wbr>Iterator</a></dt><dd>An iterator that supports “random access” to its data, meaning
that you can split it at arbitrary indices and draw data from
those points.</dd><dt><a class="trait" href="trait.IntoParallelIterator.html" title="trait rayon::iter::IntoParallelIterator">Into<wbr>Parallel<wbr>Iterator</a></dt><dd><code>IntoParallelIterator</code> implements the conversion to a <a href="trait.ParallelIterator.html" title="trait rayon::iter::ParallelIterator"><code>ParallelIterator</code></a>.</dd><dt><a class="trait" href="trait.IntoParallelRefIterator.html" title="trait rayon::iter::IntoParallelRefIterator">Into<wbr>Parallel<wbr>RefIterator</a></dt><dd><code>IntoParallelRefIterator</code> implements the conversion to a
<a href="trait.ParallelIterator.html" title="trait rayon::iter::ParallelIterator"><code>ParallelIterator</code></a>, providing shared references to the data.</dd><dt><a class="trait" href="trait.IntoParallelRefMutIterator.html" title="trait rayon::iter::IntoParallelRefMutIterator">Into<wbr>Parallel<wbr>RefMut<wbr>Iterator</a></dt><dd><code>IntoParallelRefMutIterator</code> implements the conversion to a
<a href="trait.ParallelIterator.html" title="trait rayon::iter::ParallelIterator"><code>ParallelIterator</code></a>, providing mutable references to the data.</dd><dt><a class="trait" href="trait.ParallelBridge.html" title="trait rayon::iter::ParallelBridge">Parallel<wbr>Bridge</a></dt><dd>Conversion trait to convert an <code>Iterator</code> to a <code>ParallelIterator</code>.</dd><dt><a class="trait" href="trait.ParallelDrainFull.html" title="trait rayon::iter::ParallelDrainFull">Parallel<wbr>Drain<wbr>Full</a></dt><dd><code>ParallelDrainFull</code> creates a parallel iterator that moves all items
from a collection while retaining the original capacity.</dd><dt><a class="trait" href="trait.ParallelDrainRange.html" title="trait rayon::iter::ParallelDrainRange">Parallel<wbr>Drain<wbr>Range</a></dt><dd><code>ParallelDrainRange</code> creates a parallel iterator that moves a range of items
from a collection while retaining the original capacity.</dd><dt><a class="trait" href="trait.ParallelExtend.html" title="trait rayon::iter::ParallelExtend">Parallel<wbr>Extend</a></dt><dd><code>ParallelExtend</code> extends an existing collection with items from a <a href="trait.ParallelIterator.html" title="trait rayon::iter::ParallelIterator"><code>ParallelIterator</code></a>.</dd><dt><a class="trait" href="trait.ParallelIterator.html" title="trait rayon::iter::ParallelIterator">Parallel<wbr>Iterator</a></dt><dd>Parallel version of the standard iterator trait.</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.empty.html" title="fn rayon::iter::empty">empty</a></dt><dd>Creates a parallel iterator that produces nothing.</dd><dt><a class="fn" href="fn.once.html" title="fn rayon::iter::once">once</a></dt><dd>Creates a parallel iterator that produces an element exactly once.</dd><dt><a class="fn" href="fn.repeat.html" title="fn rayon::iter::repeat">repeat</a></dt><dd>Creates a parallel iterator that endlessly repeats <code>element</code> (by
cloning it). Note that this iterator has “infinite” length, so
typically you would want to use <code>zip</code> or <code>take</code> or some other
means to shorten it, or consider using
<a href="fn.repeat_n.html" title="fn rayon::iter::repeat_n">the <code>repeat_n()</code> function</a> instead.</dd><dt><a class="fn" href="fn.repeat_n.html" title="fn rayon::iter::repeat_n">repeat_<wbr>n</a></dt><dd>Creates a parallel iterator that produces <code>n</code> repeats of <code>element</code>
(by cloning it).</dd><dt><a class="fn" href="fn.repeatn.html" title="fn rayon::iter::repeatn">repeatn</a><wbr><span class="stab deprecated" title="">Deprecated</span></dt><dd>Creates a parallel iterator that produces <code>n</code> repeats of <code>element</code>
(by cloning it).</dd><dt><a class="fn" href="fn.split.html" title="fn rayon::iter::split">split</a></dt><dd>The <code>split</code> function takes arbitrary data and a closure that knows how to
split it, and turns this into a <code>ParallelIterator</code>.</dd><dt><a class="fn" href="fn.walk_tree.html" title="fn rayon::iter::walk_tree">walk_<wbr>tree</a></dt><dd>Create a tree like parallel iterator from an initial root node.
The <code>children_of</code> function should take a node and iterate on all of its child nodes.
The best parallelization is obtained when the tree is balanced
but we should also be able to handle harder cases.</dd><dt><a class="fn" href="fn.walk_tree_postfix.html" title="fn rayon::iter::walk_tree_postfix">walk_<wbr>tree_<wbr>postfix</a></dt><dd>Create a tree like postfix parallel iterator from an initial root node.
The <code>children_of</code> function should take a node and iterate on all of its child nodes.
The best parallelization is obtained when the tree is balanced
but we should also be able to handle harder cases.</dd><dt><a class="fn" href="fn.walk_tree_prefix.html" title="fn rayon::iter::walk_tree_prefix">walk_<wbr>tree_<wbr>prefix</a></dt><dd>Create a tree-like prefix parallel iterator from an initial root node.
The <code>children_of</code> function should take a node and return an iterator over its child nodes.
The best parallelization is obtained when the tree is balanced
but we should also be able to handle harder cases.</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/iter/struct.Inspect.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rayon/iter/struct.Inspect.html">../../../rayon/iter/struct.Inspect.html</a>...</p>
<script>location.replace("../../../rayon/iter/struct.Inspect.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/iter/struct.Interleave.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rayon/iter/struct.Interleave.html">../../../rayon/iter/struct.Interleave.html</a>...</p>
<script>location.replace("../../../rayon/iter/struct.Interleave.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/iter/struct.InterleaveShortest.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rayon/iter/struct.InterleaveShortest.html">../../../rayon/iter/struct.InterleaveShortest.html</a>...</p>
<script>location.replace("../../../rayon/iter/struct.InterleaveShortest.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/iter/struct.Intersperse.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rayon/iter/struct.Intersperse.html">../../../rayon/iter/struct.Intersperse.html</a>...</p>
<script>location.replace("../../../rayon/iter/struct.Intersperse.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/iter/struct.MaxLen.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rayon/iter/struct.MaxLen.html">../../../rayon/iter/struct.MaxLen.html</a>...</p>
<script>location.replace("../../../rayon/iter/struct.MaxLen.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/iter/struct.MinLen.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rayon/iter/struct.MinLen.html">../../../rayon/iter/struct.MinLen.html</a>...</p>
<script>location.replace("../../../rayon/iter/struct.MinLen.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/iter/struct.Map.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rayon/iter/struct.Map.html">../../../rayon/iter/struct.Map.html</a>...</p>
<script>location.replace("../../../rayon/iter/struct.Map.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/iter/struct.MapInit.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rayon/iter/struct.MapInit.html">../../../rayon/iter/struct.MapInit.html</a>...</p>
<script>location.replace("../../../rayon/iter/struct.MapInit.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/iter/struct.MapWith.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rayon/iter/struct.MapWith.html">../../../rayon/iter/struct.MapWith.html</a>...</p>
<script>location.replace("../../../rayon/iter/struct.MapWith.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/iter/struct.MultiZip.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rayon/iter/struct.MultiZip.html">../../../rayon/iter/struct.MultiZip.html</a>...</p>
<script>location.replace("../../../rayon/iter/struct.MultiZip.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/iter/fn.once.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../rayon/iter/fn.once.html">../../../rayon/iter/fn.once.html</a>...</p>
<script>location.replace("../../../rayon/iter/fn.once.html" + location.search + location.hash);</script>
</body>
</html>

Some files were not shown because too many files have changed in this diff Show More