You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Trac3r-rust/doc/rayon_core/index.html

75 lines
12 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `rayon_core` crate."><meta name="keywords" content="rust, rustlang, rust-lang, rayon_core"><title>rayon_core - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../rayon_core/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Crate rayon_core</p><div class="sidebar-elems"><a id='all-types' href='all.html'><p>See all rayon_core's items</p></a><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#functions">Functions</a></li></ul></div><p class='location'></p><script>window.sidebarCurrent = {name: 'rayon_core', ty: 'mod', relpath: '../'};</script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span><a class='srclink' href='../src/rayon_core/lib.rs.html#1-765' title='goto source code'>[src]</a></span><span class='in-band'>Crate <a class="mod" href=''>rayon_core</a></span></h1><div class='docblock'><p><a href="https://github.com/rayon-rs/rayon/issues/231">Under construction</a></p>
<h2 id="restricting-multiple-versions" class="section-header"><a href="#restricting-multiple-versions">Restricting multiple versions</a></h2>
<p>In order to ensure proper coordination between threadpools, and especially
to make sure there's only one global threadpool, <code>rayon-core</code> is actively
restricted from building multiple versions of itself into a single target.
You may see a build error like this in violation:</p>
<pre><code class="language-text">error: native library `rayon-core` is being linked to by more
than one package, and can only be linked to by one package
</code></pre>
<p>While we strive to keep <code>rayon-core</code> semver-compatible, it's still
possible to arrive at this situation if different crates have overly
restrictive tilde or inequality requirements for <code>rayon-core</code>. The
conflicting requirements will need to be resolved before the build will
succeed.</p>
</div><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
<table><tr class='module-item'><td><a class="struct" href="struct.Configuration.html" title='rayon_core::Configuration struct'>Configuration</a></td><td class='docblock-short'><span class="stab deprecated">Deprecated</span><p>Contains the rayon thread pool configuration. Use <a href="struct.ThreadPoolBuilder.html"><code>ThreadPoolBuilder</code></a> instead.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.FnContext.html" title='rayon_core::FnContext struct'>FnContext</a></td><td class='docblock-short'><p>Provides the calling context to a closure called by <code>join_context</code>.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Scope.html" title='rayon_core::Scope struct'>Scope</a></td><td class='docblock-short'><p>Represents a fork-join scope which can be used to spawn any number of tasks.
See <a href="fn.scope.html"><code>scope()</code></a> for more information.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.ScopeFifo.html" title='rayon_core::ScopeFifo struct'>ScopeFifo</a></td><td class='docblock-short'><p>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"><code>scope_fifo()</code></a> for more information.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.ThreadBuilder.html" title='rayon_core::ThreadBuilder struct'>ThreadBuilder</a></td><td class='docblock-short'><p>Thread builder used for customization via
<a href="struct.ThreadPoolBuilder.html#method.spawn_handler"><code>ThreadPoolBuilder::spawn_handler</code></a>.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.ThreadPool.html" title='rayon_core::ThreadPool struct'>ThreadPool</a></td><td class='docblock-short'><p>Represents a user created <a href="https://en.wikipedia.org/wiki/Thread_pool">thread-pool</a>.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.ThreadPoolBuildError.html" title='rayon_core::ThreadPoolBuildError struct'>ThreadPoolBuildError</a></td><td class='docblock-short'><p>Error when initializing a thread pool.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.ThreadPoolBuilder.html" title='rayon_core::ThreadPoolBuilder struct'>ThreadPoolBuilder</a></td><td class='docblock-short'><p>Used to create a new <a href="struct.ThreadPool.html"><code>ThreadPool</code></a> or to configure the global rayon thread pool.</p>
</td></tr></table><h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2>
<table><tr class='module-item'><td><a class="fn" href="fn.current_num_threads.html" title='rayon_core::current_num_threads fn'>current_num_threads</a></td><td class='docblock-short'><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>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.current_thread_has_pending_tasks.html" title='rayon_core::current_thread_has_pending_tasks fn'>current_thread_has_pending_tasks</a></td><td class='docblock-short'><p>If called from a Rayon worker thread, indicates whether that
thread's local deque still has pending tasks. Otherwise, returns
<code>None</code>. For more information, see <a href="struct.ThreadPool.html#method.current_thread_has_pending_tasks">the
<code>ThreadPool::current_thread_has_pending_tasks()</code> method</a>.</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.current_thread_index.html" title='rayon_core::current_thread_index fn'>current_thread_index</a></td><td class='docblock-short'><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>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.initialize.html" title='rayon_core::initialize fn'>initialize</a></td><td class='docblock-short'><span class="stab deprecated">Deprecated</span><p>Deprecated in favor of <code>ThreadPoolBuilder::build_global</code>.</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.join.html" title='rayon_core::join fn'>join</a></td><td class='docblock-short'><p>Takes two closures and <em>potentially</em> runs them in parallel. It
returns a pair of the results from those closures.</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.join_context.html" title='rayon_core::join_context fn'>join_context</a></td><td class='docblock-short'><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 they're 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>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.scope.html" title='rayon_core::scope fn'>scope</a></td><td class='docblock-short'><p>Create a &quot;fork-join&quot; 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>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.scope_fifo.html" title='rayon_core::scope_fifo fn'>scope_fifo</a></td><td class='docblock-short'><p>Create a &quot;fork-join&quot; 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>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.spawn.html" title='rayon_core::spawn fn'>spawn</a></td><td class='docblock-short'><p>Fires off a task into the Rayon threadpool in the &quot;static&quot; or
&quot;global&quot; 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">the <code>scope()</code>
function</a> to create a scope.</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.spawn_fifo.html" title='rayon_core::spawn_fifo fn'>spawn_fifo</a></td><td class='docblock-short'><p>Fires off a task into the Rayon threadpool in the &quot;static&quot; or
&quot;global&quot; 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">the <code>scope_fifo()</code>
function</a> to create a scope.</p>
</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd></kbd></dt><dd>Move up in search results</dd><dt><kbd></kbd></dt><dd>Move down in search results</dd><dt><kbd></kbd></dt><dd>Switch tab</dd><dt><kbd>&#9166;</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "rayon_core";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>