Adding large folders

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

View File

@@ -0,0 +1,6 @@
<!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 new `Waker` which does nothing when `wake()` is called on it."><title>noop_waker in futures_util::task - 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="futures_util" 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="#">noop_waker</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../futures_util/index.html">futures_<wbr>util</a><span class="version">0.3.32</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">noop_<wbr>waker</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 futures_<wbr>util::<wbr>task</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">futures_util</a>::<wbr><a href="index.html">task</a></div><h1>Function <span class="fn">noop_<wbr>waker</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/futures_task/noop_waker.rs.html#29">Source</a> </span></div><pre class="rust item-decl"><code>pub fn noop_waker() -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/task/wake/struct.Waker.html" title="struct core::task::wake::Waker">Waker</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Create a new <a href="https://doc.rust-lang.org/1.93.1/core/task/wake/struct.Waker.html" title="struct core::task::wake::Waker"><code>Waker</code></a> which does
nothing when <code>wake()</code> is called on 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>futures::task::noop_waker;
<span class="kw">let </span>waker = noop_waker();
waker.wake();</code></pre></div></div></details></section></div></main></body></html>

View File

@@ -0,0 +1,6 @@
<!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="Get a static reference to a `Waker` which does nothing when `wake()` is called on it."><title>noop_waker_ref in futures_util::task - 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="futures_util" 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="#">noop_waker_ref</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../futures_util/index.html">futures_<wbr>util</a><span class="version">0.3.32</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">noop_<wbr>waker_<wbr>ref</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 futures_<wbr>util::<wbr>task</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">futures_util</a>::<wbr><a href="index.html">task</a></div><h1>Function <span class="fn">noop_<wbr>waker_<wbr>ref</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/futures_task/noop_waker.rs.html#45">Source</a> </span></div><pre class="rust item-decl"><code>pub fn noop_waker_ref() -&gt; &amp;'static <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/task/wake/struct.Waker.html" title="struct core::task::wake::Waker">Waker</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Get a static reference to a <a href="https://doc.rust-lang.org/1.93.1/core/task/wake/struct.Waker.html" title="struct core::task::wake::Waker"><code>Waker</code></a> which
does nothing when <code>wake()</code> is called on 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>futures::task::noop_waker_ref;
<span class="kw">let </span>waker = noop_waker_ref();
waker.wake_by_ref();</code></pre></div></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="Creates a `Waker` from an `Arc&#60;impl ArcWake&#62;`."><title>waker in futures_util::task - 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="futures_util" 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="#">waker</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../futures_util/index.html">futures_<wbr>util</a><span class="version">0.3.32</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In futures_<wbr>util::<wbr>task</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">futures_util</a>::<wbr><a href="index.html">task</a></div><h1>Function <span class="fn">waker</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/futures_task/waker.rs.html#19-21">Source</a> </span></div><pre class="rust item-decl"><code>pub fn waker&lt;W&gt;(wake: <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;W&gt;) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/task/wake/struct.Waker.html" title="struct core::task::wake::Waker">Waker</a><div class="where">where
W: <a class="trait" href="trait.ArcWake.html" title="trait futures_util::task::ArcWake">ArcWake</a> + 'static,</div></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Creates a <a href="https://doc.rust-lang.org/1.93.1/core/task/wake/struct.Waker.html" title="struct core::task::wake::Waker"><code>Waker</code></a> from an <code>Arc&lt;impl ArcWake&gt;</code>.</p>
<p>The returned <a href="https://doc.rust-lang.org/1.93.1/core/task/wake/struct.Waker.html" title="struct core::task::wake::Waker"><code>Waker</code></a> will call
<a href="trait.ArcWake.html#method.wake" title="method futures_util::task::ArcWake::wake"><code>ArcWake.wake()</code></a> if awoken.</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="Creates a reference to a `Waker` from a reference to `Arc&#60;impl ArcWake&#62;`."><title>waker_ref in futures_util::task - 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="futures_util" 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="#">waker_ref</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../futures_util/index.html">futures_<wbr>util</a><span class="version">0.3.32</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In futures_<wbr>util::<wbr>task</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">futures_util</a>::<wbr><a href="index.html">task</a></div><h1>Function <span class="fn">waker_<wbr>ref</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/futures_task/waker_ref.rs.html#55-57">Source</a> </span></div><pre class="rust item-decl"><code>pub fn waker_ref&lt;W&gt;(wake: &amp;<a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;W&gt;) -&gt; <a class="struct" href="struct.WakerRef.html" title="struct futures_util::task::WakerRef">WakerRef</a>&lt;'_&gt;<div class="where">where
W: <a class="trait" href="trait.ArcWake.html" title="trait futures_util::task::ArcWake">ArcWake</a> + 'static,</div></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Creates a reference to a <a href="https://doc.rust-lang.org/1.93.1/core/task/wake/struct.Waker.html" title="struct core::task::wake::Waker"><code>Waker</code></a> from a reference to <code>Arc&lt;impl ArcWake&gt;</code>.</p>
<p>The resulting <a href="https://doc.rust-lang.org/1.93.1/core/task/wake/struct.Waker.html" title="struct core::task::wake::Waker"><code>Waker</code></a> will call
<a href="trait.ArcWake.html#method.wake" title="method futures_util::task::ArcWake::wake"><code>ArcWake.wake()</code></a> if awoken.</p>
</div></details></section></div></main></body></html>

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="Tools for working with tasks."><title>futures_util::task - 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="futures_util" 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 task</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../futures_util/index.html">futures_<wbr>util</a><span class="version">0.3.32</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module task</a></h2><h3><a href="#reexports">Module Items</a></h3><ul class="block"><li><a href="#reexports" title="Re-exports">Re-exports</a></li><li><a href="#structs" title="Structs">Structs</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 futures_<wbr>util</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">futures_util</a></div><h1>Module <span>task</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/futures_util/task/mod.rs.html#1-40">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Tools for working with tasks.</p>
<p>This module contains:</p>
<ul>
<li><a href="trait.Spawn.html" title="trait futures_util::task::Spawn"><code>Spawn</code></a>, a trait for spawning new tasks.</li>
<li><a href="https://doc.rust-lang.org/1.93.1/core/task/wake/struct.Context.html" title="struct core::task::wake::Context"><code>Context</code></a>, a context of an asynchronous task,
including a handle for waking up the task.</li>
<li><a href="https://doc.rust-lang.org/1.93.1/core/task/wake/struct.Waker.html" title="struct core::task::wake::Waker"><code>Waker</code></a>, a handle for waking up a task.</li>
</ul>
<p>The remaining types and traits in the module are used for implementing
executors or dealing with synchronization issues around task wakeup.</p>
</div></details><h2 id="reexports" class="section-header">Re-exports<a href="#reexports" class="anchor">§</a></h2><dl class="item-table reexports"><dt id="reexport.Context"><code>pub use core::task::<a class="struct" href="https://doc.rust-lang.org/1.93.1/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>;</code></dt><dt id="reexport.Poll"><code>pub use core::task::<a class="enum" href="https://doc.rust-lang.org/1.93.1/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>;</code></dt><dt id="reexport.RawWaker"><code>pub use core::task::<a class="struct" href="https://doc.rust-lang.org/1.93.1/core/task/wake/struct.RawWaker.html" title="struct core::task::wake::RawWaker">RawWaker</a>;</code></dt><dt id="reexport.RawWakerVTable"><code>pub use core::task::<a class="struct" href="https://doc.rust-lang.org/1.93.1/core/task/wake/struct.RawWakerVTable.html" title="struct core::task::wake::RawWakerVTable">RawWakerVTable</a>;</code></dt><dt id="reexport.Waker"><code>pub use core::task::<a class="struct" href="https://doc.rust-lang.org/1.93.1/core/task/wake/struct.Waker.html" title="struct core::task::wake::Waker">Waker</a>;</code></dt></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.AtomicWaker.html" title="struct futures_util::task::AtomicWaker">Atomic<wbr>Waker</a></dt><dd>A synchronization primitive for task wakeup.</dd><dt><a class="struct" href="struct.FutureObj.html" title="struct futures_util::task::FutureObj">Future<wbr>Obj</a></dt><dd>A custom trait object for polling futures, roughly akin to
<code>Box&lt;dyn Future&lt;Output = T&gt; + Send + 'a&gt;</code>.</dd><dt><a class="struct" href="struct.LocalFutureObj.html" title="struct futures_util::task::LocalFutureObj">Local<wbr>Future<wbr>Obj</a></dt><dd>A custom trait object for polling futures, roughly akin to
<code>Box&lt;dyn Future&lt;Output = T&gt; + 'a&gt;</code>.</dd><dt><a class="struct" href="struct.SpawnError.html" title="struct futures_util::task::SpawnError">Spawn<wbr>Error</a></dt><dd>An error that occurred during spawning.</dd><dt><a class="struct" href="struct.WakerRef.html" title="struct futures_util::task::WakerRef">Waker<wbr>Ref</a></dt><dd>A <a href="https://doc.rust-lang.org/1.93.1/core/task/wake/struct.Waker.html" title="struct core::task::wake::Waker"><code>Waker</code></a> that is only valid for a given lifetime.</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.ArcWake.html" title="trait futures_util::task::ArcWake">ArcWake</a></dt><dd>A way of waking up a specific task.</dd><dt><a class="trait" href="trait.LocalSpawn.html" title="trait futures_util::task::LocalSpawn">Local<wbr>Spawn</a></dt><dd>The <code>LocalSpawn</code> is similar to <a href="trait.Spawn.html" title="trait futures_util::task::Spawn"><code>Spawn</code></a>, but allows spawning futures
that dont implement <code>Send</code>.</dd><dt><a class="trait" href="trait.LocalSpawnExt.html" title="trait futures_util::task::LocalSpawnExt">Local<wbr>Spawn<wbr>Ext</a></dt><dd>Extension trait for <code>LocalSpawn</code>.</dd><dt><a class="trait" href="trait.Spawn.html" title="trait futures_util::task::Spawn">Spawn</a></dt><dd>The <code>Spawn</code> trait allows for pushing futures onto an executor that will
run them to completion.</dd><dt><a class="trait" href="trait.SpawnExt.html" title="trait futures_util::task::SpawnExt">Spawn<wbr>Ext</a></dt><dd>Extension trait for <code>Spawn</code>.</dd><dt><a class="trait" href="trait.UnsafeFutureObj.html" title="trait futures_util::task::UnsafeFutureObj">Unsafe<wbr>Future<wbr>Obj</a></dt><dd>A custom implementation of a future trait object for <code>FutureObj</code>, providing
a vtable with drop support.</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.noop_waker.html" title="fn futures_util::task::noop_waker">noop_<wbr>waker</a></dt><dd>Create a new <a href="https://doc.rust-lang.org/1.93.1/core/task/wake/struct.Waker.html" title="struct core::task::wake::Waker"><code>Waker</code></a> which does
nothing when <code>wake()</code> is called on it.</dd><dt><a class="fn" href="fn.noop_waker_ref.html" title="fn futures_util::task::noop_waker_ref">noop_<wbr>waker_<wbr>ref</a></dt><dd>Get a static reference to a <a href="https://doc.rust-lang.org/1.93.1/core/task/wake/struct.Waker.html" title="struct core::task::wake::Waker"><code>Waker</code></a> which
does nothing when <code>wake()</code> is called on it.</dd><dt><a class="fn" href="fn.waker.html" title="fn futures_util::task::waker">waker</a></dt><dd>Creates a <a href="https://doc.rust-lang.org/1.93.1/core/task/wake/struct.Waker.html" title="struct core::task::wake::Waker"><code>Waker</code></a> from an <code>Arc&lt;impl ArcWake&gt;</code>.</dd><dt><a class="fn" href="fn.waker_ref.html" title="fn futures_util::task::waker_ref">waker_<wbr>ref</a></dt><dd>Creates a reference to a <a href="https://doc.rust-lang.org/1.93.1/core/task/wake/struct.Waker.html" title="struct core::task::wake::Waker"><code>Waker</code></a> from a reference to <code>Arc&lt;impl ArcWake&gt;</code>.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"fn":["noop_waker","noop_waker_ref","waker","waker_ref"],"struct":["AtomicWaker","FutureObj","LocalFutureObj","SpawnError","WakerRef"],"trait":["ArcWake","LocalSpawn","LocalSpawnExt","Spawn","SpawnExt","UnsafeFutureObj"]};

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../futures_util/task/trait.LocalSpawnExt.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../futures_util/task/trait.LocalSpawnExt.html">../../../futures_util/task/trait.LocalSpawnExt.html</a>...</p>
<script>location.replace("../../../futures_util/task/trait.LocalSpawnExt.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=../../../futures_util/task/trait.SpawnExt.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../futures_util/task/trait.SpawnExt.html">../../../futures_util/task/trait.SpawnExt.html</a>...</p>
<script>location.replace("../../../futures_util/task/trait.SpawnExt.html" + location.search + location.hash);</script>
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,32 @@
<!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="A way of waking up a specific task."><title>ArcWake in futures_util::task - 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="futures_util" 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 trait"><!--[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="#">ArcWake</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../futures_util/index.html">futures_<wbr>util</a><span class="version">0.3.32</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">ArcWake</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.wake_by_ref" title="wake_by_ref">wake_by_ref</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.wake" title="wake">wake</a></li></ul><h3><a href="#dyn-compatibility">Dyn Compatibility</a></h3><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In futures_<wbr>util::<wbr>task</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">futures_util</a>::<wbr><a href="index.html">task</a></div><h1>Trait <span class="trait">ArcWake</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/futures_task/arc_wake.rs.html#20">Source</a> </span></div><pre class="rust item-decl"><code>pub trait ArcWake: <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> {
// Required method
fn <a href="#tymethod.wake_by_ref" class="fn">wake_by_ref</a>(arc_self: &amp;<a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;Self&gt;);
// Provided method
fn <a href="#method.wake" class="fn">wake</a>(self: <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;Self&gt;) { ... }
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A way of waking up a specific task.</p>
<p>By implementing this trait, types that are expected to be wrapped in an <code>Arc</code>
can be converted into <a href="https://doc.rust-lang.org/1.93.1/core/task/wake/struct.Waker.html" title="struct core::task::wake::Waker"><code>Waker</code></a> objects.
Those Wakers can be used to signal executors that a task it owns
is ready to be <code>poll</code>ed again.</p>
<p>Currently, there are two ways to convert <code>ArcWake</code> into <a href="https://doc.rust-lang.org/1.93.1/core/task/wake/struct.Waker.html" title="struct core::task::wake::Waker"><code>Waker</code></a>:</p>
<ul>
<li><a href="fn.waker.html" title="fn futures_util::task::waker"><code>waker</code></a> converts <code>Arc&lt;impl ArcWake&gt;</code> into <a href="https://doc.rust-lang.org/1.93.1/core/task/wake/struct.Waker.html" title="struct core::task::wake::Waker"><code>Waker</code></a>.</li>
<li><a href="fn.waker_ref.html" title="fn futures_util::task::waker_ref"><code>waker_ref</code></a> converts <code>&amp;Arc&lt;impl ArcWake&gt;</code> into <a href="struct.WakerRef.html" title="struct futures_util::task::WakerRef"><code>WakerRef</code></a> that
provides access to a <a href="https://doc.rust-lang.org/1.93.1/core/task/wake/struct.Waker.html" title="struct core::task::wake::Waker"><code>&amp;Waker</code></a>.</li>
</ul>
</div></details><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.wake_by_ref" class="method"><a class="src rightside" href="../../src/futures_task/arc_wake.rs.html#48">Source</a><h4 class="code-header">fn <a href="#tymethod.wake_by_ref" class="fn">wake_by_ref</a>(arc_self: &amp;<a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;Self&gt;)</h4></section></summary><div class="docblock"><p>Indicates that the associated task is ready to make progress and should
be <code>poll</code>ed.</p>
<p>This function can be called from an arbitrary thread, including threads which
did not create the <code>ArcWake</code> based <a href="https://doc.rust-lang.org/1.93.1/core/task/wake/struct.Waker.html" title="struct core::task::wake::Waker"><code>Waker</code></a>.</p>
<p>Executors generally maintain a queue of “ready” tasks; <code>wake_by_ref</code> should place
the associated task onto this queue.</p>
<p>This function is similar to <a href="trait.ArcWake.html#method.wake" title="method futures_util::task::ArcWake::wake"><code>wake</code></a>, but must not consume the provided data
pointer.</p>
</div></details></div><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.wake" class="method"><a class="src rightside" href="../../src/futures_task/arc_wake.rs.html#31">Source</a><h4 class="code-header">fn <a href="#method.wake" class="fn">wake</a>(self: <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;Self&gt;)</h4></section></summary><div class="docblock"><p>Indicates that the associated task is ready to make progress and should
be <code>poll</code>ed.</p>
<p>This function can be called from an arbitrary thread, including threads which
did not create the <code>ArcWake</code> based <a href="https://doc.rust-lang.org/1.93.1/core/task/wake/struct.Waker.html" title="struct core::task::wake::Waker"><code>Waker</code></a>.</p>
<p>Executors generally maintain a queue of “ready” tasks; <code>wake</code> should place
the associated task onto this queue.</p>
</div></details></div><h2 id="dyn-compatibility" class="section-header">Dyn Compatibility<a href="#dyn-compatibility" class="anchor">§</a></h2><div class="dyn-compatibility-info"><p>This trait is <b>not</b> <a href="https://doc.rust-lang.org/1.93.1/reference/items/traits.html#dyn-compatibility">dyn compatible</a>.</p><p><i>In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.</i></p></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"></div><script src="../../trait.impl/futures_task/arc_wake/trait.ArcWake.js" async></script></section></div></main></body></html>

View File

@@ -0,0 +1,46 @@
<!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 `LocalSpawn` is similar to `Spawn`, but allows spawning futures that dont implement `Send`."><title>LocalSpawn in futures_util::task - 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="futures_util" 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 trait"><!--[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="#">LocalSpawn</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../futures_util/index.html">futures_<wbr>util</a><span class="version">0.3.32</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Local<wbr>Spawn</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.spawn_local_obj" title="spawn_local_obj">spawn_local_obj</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.status_local" title="status_local">status_local</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-LocalSpawn-for-%26Sp" title="&#38;Sp">&#38;Sp</a></li><li><a href="#impl-LocalSpawn-for-%26mut+Sp" title="&#38;mut Sp">&#38;mut Sp</a></li><li><a href="#impl-LocalSpawn-for-Arc%3CSp%3E" title="Arc&#60;Sp&#62;">Arc&#60;Sp&#62;</a></li><li><a href="#impl-LocalSpawn-for-Box%3CSp%3E" title="Box&#60;Sp&#62;">Box&#60;Sp&#62;</a></li><li><a href="#impl-LocalSpawn-for-Rc%3CSp%3E" title="Rc&#60;Sp&#62;">Rc&#60;Sp&#62;</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In futures_<wbr>util::<wbr>task</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">futures_util</a>::<wbr><a href="index.html">task</a></div><h1>Trait <span class="trait">Local<wbr>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/futures_task/spawn.rs.html#31">Source</a> </span></div><pre class="rust item-decl"><code>pub trait LocalSpawn {
// Required method
fn <a href="#tymethod.spawn_local_obj" class="fn">spawn_local_obj</a>(
&amp;self,
future: <a class="struct" href="../future/struct.LocalFutureObj.html" title="struct futures_util::future::LocalFutureObj">LocalFutureObj</a>&lt;'static, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>&gt;,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, <a class="struct" href="struct.SpawnError.html" title="struct futures_util::task::SpawnError">SpawnError</a>&gt;;
// Provided method
fn <a href="#method.status_local" class="fn">status_local</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, <a class="struct" href="struct.SpawnError.html" title="struct futures_util::task::SpawnError">SpawnError</a>&gt; { ... }
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The <code>LocalSpawn</code> is similar to <a href="trait.Spawn.html" title="trait futures_util::task::Spawn"><code>Spawn</code></a>, but allows spawning futures
that dont implement <code>Send</code>.</p>
</div></details><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.spawn_local_obj" class="method"><a class="src rightside" href="../../src/futures_task/spawn.rs.html#40">Source</a><h4 class="code-header">fn <a href="#tymethod.spawn_local_obj" class="fn">spawn_local_obj</a>(
&amp;self,
future: <a class="struct" href="../future/struct.LocalFutureObj.html" title="struct futures_util::future::LocalFutureObj">LocalFutureObj</a>&lt;'static, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>&gt;,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, <a class="struct" href="struct.SpawnError.html" title="struct futures_util::task::SpawnError">SpawnError</a>&gt;</h4></section></summary><div class="docblock"><p>Spawns a future that will be run to completion.</p>
<h5 id="errors"><a class="doc-anchor" href="#errors">§</a>Errors</h5>
<p>The executor may be unable to spawn tasks. Spawn errors should
represent relatively rare scenarios, such as the executor
having been shut down so that it is no longer able to accept
tasks.</p>
</div></details></div><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.status_local" class="method"><a class="src rightside" href="../../src/futures_task/spawn.rs.html#49">Source</a><h4 class="code-header">fn <a href="#method.status_local" class="fn">status_local</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, <a class="struct" href="struct.SpawnError.html" title="struct futures_util::task::SpawnError">SpawnError</a>&gt;</h4></section></summary><div class="docblock"><p>Determines whether the executor is able to spawn new tasks.</p>
<p>This method will return <code>Ok</code> when the executor is <em>likely</em>
(but not guaranteed) to accept a subsequent spawn attempt.
Likewise, an <code>Err</code> return means that <code>spawn</code> is likely, but
not guaranteed, to yield an error.</p>
</div></details></div><h2 id="foreign-impls" class="section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor">§</a></h2><details class="toggle implementors-toggle"><summary><section id="impl-LocalSpawn-for-%26Sp" class="impl"><a class="src rightside" href="../../src/futures_task/spawn.rs.html#106">Source</a><a href="#impl-LocalSpawn-for-%26Sp" class="anchor">§</a><h3 class="code-header">impl&lt;Sp&gt; <a class="trait" href="trait.LocalSpawn.html" title="trait futures_util::task::LocalSpawn">LocalSpawn</a> for <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;Sp</a><div class="where">where
Sp: <a class="trait" href="trait.LocalSpawn.html" title="trait futures_util::task::LocalSpawn">LocalSpawn</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><section id="method.spawn_local_obj" class="method trait-impl"><a class="src rightside" href="../../src/futures_task/spawn.rs.html#107">Source</a><a href="#method.spawn_local_obj" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.spawn_local_obj" class="fn">spawn_local_obj</a>(
&amp;self,
future: <a class="struct" href="../future/struct.LocalFutureObj.html" title="struct futures_util::future::LocalFutureObj">LocalFutureObj</a>&lt;'static, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>&gt;,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, <a class="struct" href="struct.SpawnError.html" title="struct futures_util::task::SpawnError">SpawnError</a>&gt;</h4></section><section id="method.status_local-1" class="method trait-impl"><a class="src rightside" href="../../src/futures_task/spawn.rs.html#111">Source</a><a href="#method.status_local-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.status_local" class="fn">status_local</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, <a class="struct" href="struct.SpawnError.html" title="struct futures_util::task::SpawnError">SpawnError</a>&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-LocalSpawn-for-%26mut+Sp" class="impl"><a class="src rightside" href="../../src/futures_task/spawn.rs.html#116">Source</a><a href="#impl-LocalSpawn-for-%26mut+Sp" class="anchor">§</a><h3 class="code-header">impl&lt;Sp&gt; <a class="trait" href="trait.LocalSpawn.html" title="trait futures_util::task::LocalSpawn">LocalSpawn</a> for <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;mut Sp</a><div class="where">where
Sp: <a class="trait" href="trait.LocalSpawn.html" title="trait futures_util::task::LocalSpawn">LocalSpawn</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><section id="method.spawn_local_obj-1" class="method trait-impl"><a class="src rightside" href="../../src/futures_task/spawn.rs.html#117">Source</a><a href="#method.spawn_local_obj-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.spawn_local_obj" class="fn">spawn_local_obj</a>(
&amp;self,
future: <a class="struct" href="../future/struct.LocalFutureObj.html" title="struct futures_util::future::LocalFutureObj">LocalFutureObj</a>&lt;'static, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>&gt;,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, <a class="struct" href="struct.SpawnError.html" title="struct futures_util::task::SpawnError">SpawnError</a>&gt;</h4></section><section id="method.status_local-2" class="method trait-impl"><a class="src rightside" href="../../src/futures_task/spawn.rs.html#121">Source</a><a href="#method.status_local-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.status_local" class="fn">status_local</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, <a class="struct" href="struct.SpawnError.html" title="struct futures_util::task::SpawnError">SpawnError</a>&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-LocalSpawn-for-Box%3CSp%3E" class="impl"><a class="src rightside" href="../../src/futures_task/spawn.rs.html#141">Source</a><a href="#impl-LocalSpawn-for-Box%3CSp%3E" class="anchor">§</a><h3 class="code-header">impl&lt;Sp&gt; <a class="trait" href="trait.LocalSpawn.html" title="trait futures_util::task::LocalSpawn">LocalSpawn</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;Sp&gt;<div class="where">where
Sp: <a class="trait" href="trait.LocalSpawn.html" title="trait futures_util::task::LocalSpawn">LocalSpawn</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><section id="method.spawn_local_obj-2" class="method trait-impl"><a class="src rightside" href="../../src/futures_task/spawn.rs.html#142">Source</a><a href="#method.spawn_local_obj-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.spawn_local_obj" class="fn">spawn_local_obj</a>(
&amp;self,
future: <a class="struct" href="../future/struct.LocalFutureObj.html" title="struct futures_util::future::LocalFutureObj">LocalFutureObj</a>&lt;'static, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>&gt;,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, <a class="struct" href="struct.SpawnError.html" title="struct futures_util::task::SpawnError">SpawnError</a>&gt;</h4></section><section id="method.status_local-3" class="method trait-impl"><a class="src rightside" href="../../src/futures_task/spawn.rs.html#146">Source</a><a href="#method.status_local-3" class="anchor">§</a><h4 class="code-header">fn <a href="#method.status_local" class="fn">status_local</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, <a class="struct" href="struct.SpawnError.html" title="struct futures_util::task::SpawnError">SpawnError</a>&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-LocalSpawn-for-Rc%3CSp%3E" class="impl"><a class="src rightside" href="../../src/futures_task/spawn.rs.html#161">Source</a><a href="#impl-LocalSpawn-for-Rc%3CSp%3E" class="anchor">§</a><h3 class="code-header">impl&lt;Sp&gt; <a class="trait" href="trait.LocalSpawn.html" title="trait futures_util::task::LocalSpawn">LocalSpawn</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/rc/struct.Rc.html" title="struct alloc::rc::Rc">Rc</a>&lt;Sp&gt;<div class="where">where
Sp: <a class="trait" href="trait.LocalSpawn.html" title="trait futures_util::task::LocalSpawn">LocalSpawn</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><section id="method.spawn_local_obj-3" class="method trait-impl"><a class="src rightside" href="../../src/futures_task/spawn.rs.html#162">Source</a><a href="#method.spawn_local_obj-3" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.spawn_local_obj" class="fn">spawn_local_obj</a>(
&amp;self,
future: <a class="struct" href="../future/struct.LocalFutureObj.html" title="struct futures_util::future::LocalFutureObj">LocalFutureObj</a>&lt;'static, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>&gt;,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, <a class="struct" href="struct.SpawnError.html" title="struct futures_util::task::SpawnError">SpawnError</a>&gt;</h4></section><section id="method.status_local-4" class="method trait-impl"><a class="src rightside" href="../../src/futures_task/spawn.rs.html#166">Source</a><a href="#method.status_local-4" class="anchor">§</a><h4 class="code-header">fn <a href="#method.status_local" class="fn">status_local</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, <a class="struct" href="struct.SpawnError.html" title="struct futures_util::task::SpawnError">SpawnError</a>&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-LocalSpawn-for-Arc%3CSp%3E" class="impl"><a class="src rightside" href="../../src/futures_task/spawn.rs.html#183">Source</a><a href="#impl-LocalSpawn-for-Arc%3CSp%3E" class="anchor">§</a><h3 class="code-header">impl&lt;Sp&gt; <a class="trait" href="trait.LocalSpawn.html" title="trait futures_util::task::LocalSpawn">LocalSpawn</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;Sp&gt;<div class="where">where
Sp: <a class="trait" href="trait.LocalSpawn.html" title="trait futures_util::task::LocalSpawn">LocalSpawn</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><section id="method.spawn_local_obj-4" class="method trait-impl"><a class="src rightside" href="../../src/futures_task/spawn.rs.html#184">Source</a><a href="#method.spawn_local_obj-4" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.spawn_local_obj" class="fn">spawn_local_obj</a>(
&amp;self,
future: <a class="struct" href="../future/struct.LocalFutureObj.html" title="struct futures_util::future::LocalFutureObj">LocalFutureObj</a>&lt;'static, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>&gt;,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, <a class="struct" href="struct.SpawnError.html" title="struct futures_util::task::SpawnError">SpawnError</a>&gt;</h4></section><section id="method.status_local-5" class="method trait-impl"><a class="src rightside" href="../../src/futures_task/spawn.rs.html#188">Source</a><a href="#method.status_local-5" class="anchor">§</a><h4 class="code-header">fn <a href="#method.status_local" class="fn">status_local</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, <a class="struct" href="struct.SpawnError.html" title="struct futures_util::task::SpawnError">SpawnError</a>&gt;</h4></section></div></details><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-LocalSpawn-for-FuturesUnordered%3CLocalFutureObj%3C'_,+()%3E%3E" class="impl"><a class="src rightside" href="../../src/futures_util/stream/futures_unordered/mod.rs.html#75-80">Source</a><a href="#impl-LocalSpawn-for-FuturesUnordered%3CLocalFutureObj%3C'_,+()%3E%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.LocalSpawn.html" title="trait futures_util::task::LocalSpawn">LocalSpawn</a> for <a class="struct" href="../stream/struct.FuturesUnordered.html" title="struct futures_util::stream::FuturesUnordered">FuturesUnordered</a>&lt;<a class="struct" href="../future/struct.LocalFutureObj.html" title="struct futures_util::future::LocalFutureObj">LocalFutureObj</a>&lt;'_, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>&gt;&gt;</h3></section></div><script src="../../trait.impl/futures_task/spawn/trait.LocalSpawn.js" data-ignore-extern-crates="alloc" async></script></section></div></main></body></html>

View File

@@ -0,0 +1,50 @@
<!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="Extension trait for `LocalSpawn`."><title>LocalSpawnExt in futures_util::task - 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="futures_util" 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 trait"><!--[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="#">LocalSpawnExt</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../futures_util/index.html">futures_<wbr>util</a><span class="version">0.3.32</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Local<wbr>Spawn<wbr>Ext</a></h2><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.spawn_local" title="spawn_local">spawn_local</a></li><li><a href="#method.spawn_local_with_handle" title="spawn_local_with_handle">spawn_local_with_handle</a></li></ul><h3><a href="#dyn-compatibility">Dyn Compatibility</a></h3><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In futures_<wbr>util::<wbr>task</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">futures_util</a>::<wbr><a href="index.html">task</a></div><h1>Trait <span class="trait">Local<wbr>Spawn<wbr>Ext</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/futures_util/task/spawn.rs.html#103-169">Source</a> </span></div><pre class="rust item-decl"><code>pub trait LocalSpawnExt: <a class="trait" href="trait.LocalSpawn.html" title="trait futures_util::task::LocalSpawn">LocalSpawn</a> {
// Provided methods
fn <a href="#method.spawn_local" class="fn">spawn_local</a>&lt;Fut&gt;(&amp;self, future: Fut) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, <a class="struct" href="struct.SpawnError.html" title="struct futures_util::task::SpawnError">SpawnError</a>&gt;
<span class="where">where Fut: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>&gt; + 'static</span> { ... }
<span class="item-spacer"></span> fn <a href="#method.spawn_local_with_handle" class="fn">spawn_local_with_handle</a>&lt;Fut&gt;(
&amp;self,
future: Fut,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="../future/struct.RemoteHandle.html" title="struct futures_util::future::RemoteHandle">RemoteHandle</a>&lt;Fut::<a class="associatedtype" href="https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html#associatedtype.Output" title="type core::future::future::Future::Output">Output</a>&gt;, <a class="struct" href="struct.SpawnError.html" title="struct futures_util::task::SpawnError">SpawnError</a>&gt;
<span class="where">where Fut: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a> + 'static</span> { ... }
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Extension trait for <code>LocalSpawn</code>.</p>
</div></details><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.spawn_local" class="method"><a class="src rightside" href="../../src/futures_util/task/spawn.rs.html#130-135">Source</a><h4 class="code-header">fn <a href="#method.spawn_local" class="fn">spawn_local</a>&lt;Fut&gt;(&amp;self, future: Fut) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, <a class="struct" href="struct.SpawnError.html" title="struct futures_util::task::SpawnError">SpawnError</a>&gt;<div class="where">where
Fut: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>&gt; + 'static,</div></h4></section></summary><div class="docblock"><p>Spawns a task that polls the given future with output <code>()</code> to
completion.</p>
<p>This method returns a <a href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result"><code>Result</code></a> that contains a <a href="struct.SpawnError.html" title="struct futures_util::task::SpawnError"><code>SpawnError</code></a> if
spawning fails.</p>
<p>You can use <a href="trait.SpawnExt.html#method.spawn_with_handle" title="method futures_util::task::SpawnExt::spawn_with_handle"><code>spawn_with_handle</code></a> if
you want to spawn a future with output other than <code>()</code> or if you want
to be able to await its completion.</p>
<p>Note this method will eventually be replaced with the upcoming
<code>Spawn::spawn</code> method which will take a <code>dyn Future</code> as input.
Technical limitations prevent <code>Spawn::spawn</code> from being implemented
today. Feel free to use this method in the meantime.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>futures::executor::LocalPool;
<span class="kw">use </span>futures::task::LocalSpawnExt;
<span class="kw">let </span>executor = LocalPool::new();
<span class="kw">let </span>spawner = executor.spawner();
<span class="kw">let </span>future = <span class="kw">async </span>{ <span class="comment">/* ... */ </span>};
spawner.spawn_local(future).unwrap();</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.spawn_local_with_handle" class="method"><a class="src rightside" href="../../src/futures_util/task/spawn.rs.html#158-168">Source</a><h4 class="code-header">fn <a href="#method.spawn_local_with_handle" class="fn">spawn_local_with_handle</a>&lt;Fut&gt;(
&amp;self,
future: Fut,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="../future/struct.RemoteHandle.html" title="struct futures_util::future::RemoteHandle">RemoteHandle</a>&lt;Fut::<a class="associatedtype" href="https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html#associatedtype.Output" title="type core::future::future::Future::Output">Output</a>&gt;, <a class="struct" href="struct.SpawnError.html" title="struct futures_util::task::SpawnError">SpawnError</a>&gt;<div class="where">where
Fut: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a> + 'static,</div></h4></section></summary><div class="docblock"><p>Spawns a task that polls the given future to completion and returns a
future that resolves to the spawned futures output.</p>
<p>This method returns a <a href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result"><code>Result</code></a> that contains a <a href="../future/struct.RemoteHandle.html" title="struct futures_util::future::RemoteHandle"><code>RemoteHandle</code></a>, or, if
spawning fails, a <a href="struct.SpawnError.html" title="struct futures_util::task::SpawnError"><code>SpawnError</code></a>. <a href="../future/struct.RemoteHandle.html" title="struct futures_util::future::RemoteHandle"><code>RemoteHandle</code></a> is a future that
resolves to the output of the spawned future.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>futures::executor::LocalPool;
<span class="kw">use </span>futures::task::LocalSpawnExt;
<span class="kw">let </span><span class="kw-2">mut </span>executor = LocalPool::new();
<span class="kw">let </span>spawner = executor.spawner();
<span class="kw">let </span>future = <span class="kw">async </span>{ <span class="number">1 </span>};
<span class="kw">let </span>join_handle_fut = spawner.spawn_local_with_handle(future).unwrap();
<span class="macro">assert_eq!</span>(executor.run_until(join_handle_fut), <span class="number">1</span>);</code></pre></div></div></details></div><h2 id="dyn-compatibility" class="section-header">Dyn Compatibility<a href="#dyn-compatibility" class="anchor">§</a></h2><div class="dyn-compatibility-info"><p>This trait is <b>not</b> <a href="https://doc.rust-lang.org/1.93.1/reference/items/traits.html#dyn-compatibility">dyn compatible</a>.</p><p><i>In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.</i></p></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-LocalSpawnExt-for-Sp" class="impl"><a class="src rightside" href="../../src/futures_util/task/spawn.rs.html#17">Source</a><a href="#impl-LocalSpawnExt-for-Sp" class="anchor">§</a><h3 class="code-header">impl&lt;Sp&gt; <a class="trait" href="trait.LocalSpawnExt.html" title="trait futures_util::task::LocalSpawnExt">LocalSpawnExt</a> for Sp<div class="where">where
Sp: <a class="trait" href="trait.LocalSpawn.html" title="trait futures_util::task::LocalSpawn">LocalSpawn</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></div><script src="../../trait.impl/futures_util/task/spawn/trait.LocalSpawnExt.js" async></script></section></div></main></body></html>

View File

@@ -0,0 +1,28 @@
<!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 `Spawn` trait allows for pushing futures onto an executor that will run them to completion."><title>Spawn in futures_util::task - 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="futures_util" 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 trait"><!--[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="../../futures_util/index.html">futures_<wbr>util</a><span class="version">0.3.32</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Spawn</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.spawn_obj" title="spawn_obj">spawn_obj</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.status" title="status">status</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-Spawn-for-%26Sp" title="&#38;Sp">&#38;Sp</a></li><li><a href="#impl-Spawn-for-%26mut+Sp" title="&#38;mut Sp">&#38;mut Sp</a></li><li><a href="#impl-Spawn-for-Arc%3CSp%3E" title="Arc&#60;Sp&#62;">Arc&#60;Sp&#62;</a></li><li><a href="#impl-Spawn-for-Box%3CSp%3E" title="Box&#60;Sp&#62;">Box&#60;Sp&#62;</a></li><li><a href="#impl-Spawn-for-Rc%3CSp%3E" title="Rc&#60;Sp&#62;">Rc&#60;Sp&#62;</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In futures_<wbr>util::<wbr>task</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">futures_util</a>::<wbr><a href="index.html">task</a></div><h1>Trait <span class="trait">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/futures_task/spawn.rs.html#6">Source</a> </span></div><pre class="rust item-decl"><code>pub trait Spawn {
// Required method
fn <a href="#tymethod.spawn_obj" class="fn">spawn_obj</a>(
&amp;self,
future: <a class="struct" href="../future/struct.FutureObj.html" title="struct futures_util::future::FutureObj">FutureObj</a>&lt;'static, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>&gt;,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, <a class="struct" href="struct.SpawnError.html" title="struct futures_util::task::SpawnError">SpawnError</a>&gt;;
// Provided method
fn <a href="#method.status" class="fn">status</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, <a class="struct" href="struct.SpawnError.html" title="struct futures_util::task::SpawnError">SpawnError</a>&gt; { ... }
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The <code>Spawn</code> trait allows for pushing futures onto an executor that will
run them to completion.</p>
</div></details><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.spawn_obj" class="method"><a class="src rightside" href="../../src/futures_task/spawn.rs.html#15">Source</a><h4 class="code-header">fn <a href="#tymethod.spawn_obj" class="fn">spawn_obj</a>(&amp;self, future: <a class="struct" href="../future/struct.FutureObj.html" title="struct futures_util::future::FutureObj">FutureObj</a>&lt;'static, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, <a class="struct" href="struct.SpawnError.html" title="struct futures_util::task::SpawnError">SpawnError</a>&gt;</h4></section></summary><div class="docblock"><p>Spawns a future that will be run to completion.</p>
<h5 id="errors"><a class="doc-anchor" href="#errors">§</a>Errors</h5>
<p>The executor may be unable to spawn tasks. Spawn errors should
represent relatively rare scenarios, such as the executor
having been shut down so that it is no longer able to accept
tasks.</p>
</div></details></div><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.status" class="method"><a class="src rightside" href="../../src/futures_task/spawn.rs.html#24">Source</a><h4 class="code-header">fn <a href="#method.status" class="fn">status</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, <a class="struct" href="struct.SpawnError.html" title="struct futures_util::task::SpawnError">SpawnError</a>&gt;</h4></section></summary><div class="docblock"><p>Determines whether the executor is able to spawn new tasks.</p>
<p>This method will return <code>Ok</code> when the executor is <em>likely</em>
(but not guaranteed) to accept a subsequent spawn attempt.
Likewise, an <code>Err</code> return means that <code>spawn</code> is likely, but
not guaranteed, to yield an error.</p>
</div></details></div><h2 id="foreign-impls" class="section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor">§</a></h2><details class="toggle implementors-toggle"><summary><section id="impl-Spawn-for-%26Sp" class="impl"><a class="src rightside" href="../../src/futures_task/spawn.rs.html#86">Source</a><a href="#impl-Spawn-for-%26Sp" class="anchor">§</a><h3 class="code-header">impl&lt;Sp&gt; <a class="trait" href="trait.Spawn.html" title="trait futures_util::task::Spawn">Spawn</a> for <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;Sp</a><div class="where">where
Sp: <a class="trait" href="trait.Spawn.html" title="trait futures_util::task::Spawn">Spawn</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><section id="method.spawn_obj" class="method trait-impl"><a class="src rightside" href="../../src/futures_task/spawn.rs.html#87">Source</a><a href="#method.spawn_obj" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.spawn_obj" class="fn">spawn_obj</a>(&amp;self, future: <a class="struct" href="../future/struct.FutureObj.html" title="struct futures_util::future::FutureObj">FutureObj</a>&lt;'static, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, <a class="struct" href="struct.SpawnError.html" title="struct futures_util::task::SpawnError">SpawnError</a>&gt;</h4></section><section id="method.status-1" class="method trait-impl"><a class="src rightside" href="../../src/futures_task/spawn.rs.html#91">Source</a><a href="#method.status-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.status" class="fn">status</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, <a class="struct" href="struct.SpawnError.html" title="struct futures_util::task::SpawnError">SpawnError</a>&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Spawn-for-%26mut+Sp" class="impl"><a class="src rightside" href="../../src/futures_task/spawn.rs.html#96">Source</a><a href="#impl-Spawn-for-%26mut+Sp" class="anchor">§</a><h3 class="code-header">impl&lt;Sp&gt; <a class="trait" href="trait.Spawn.html" title="trait futures_util::task::Spawn">Spawn</a> for <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;mut Sp</a><div class="where">where
Sp: <a class="trait" href="trait.Spawn.html" title="trait futures_util::task::Spawn">Spawn</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><section id="method.spawn_obj-1" class="method trait-impl"><a class="src rightside" href="../../src/futures_task/spawn.rs.html#97">Source</a><a href="#method.spawn_obj-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.spawn_obj" class="fn">spawn_obj</a>(&amp;self, future: <a class="struct" href="../future/struct.FutureObj.html" title="struct futures_util::future::FutureObj">FutureObj</a>&lt;'static, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, <a class="struct" href="struct.SpawnError.html" title="struct futures_util::task::SpawnError">SpawnError</a>&gt;</h4></section><section id="method.status-2" class="method trait-impl"><a class="src rightside" href="../../src/futures_task/spawn.rs.html#101">Source</a><a href="#method.status-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.status" class="fn">status</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, <a class="struct" href="struct.SpawnError.html" title="struct futures_util::task::SpawnError">SpawnError</a>&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Spawn-for-Box%3CSp%3E" class="impl"><a class="src rightside" href="../../src/futures_task/spawn.rs.html#131">Source</a><a href="#impl-Spawn-for-Box%3CSp%3E" class="anchor">§</a><h3 class="code-header">impl&lt;Sp&gt; <a class="trait" href="trait.Spawn.html" title="trait futures_util::task::Spawn">Spawn</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;Sp&gt;<div class="where">where
Sp: <a class="trait" href="trait.Spawn.html" title="trait futures_util::task::Spawn">Spawn</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><section id="method.spawn_obj-2" class="method trait-impl"><a class="src rightside" href="../../src/futures_task/spawn.rs.html#132">Source</a><a href="#method.spawn_obj-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.spawn_obj" class="fn">spawn_obj</a>(&amp;self, future: <a class="struct" href="../future/struct.FutureObj.html" title="struct futures_util::future::FutureObj">FutureObj</a>&lt;'static, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, <a class="struct" href="struct.SpawnError.html" title="struct futures_util::task::SpawnError">SpawnError</a>&gt;</h4></section><section id="method.status-3" class="method trait-impl"><a class="src rightside" href="../../src/futures_task/spawn.rs.html#136">Source</a><a href="#method.status-3" class="anchor">§</a><h4 class="code-header">fn <a href="#method.status" class="fn">status</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, <a class="struct" href="struct.SpawnError.html" title="struct futures_util::task::SpawnError">SpawnError</a>&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Spawn-for-Rc%3CSp%3E" class="impl"><a class="src rightside" href="../../src/futures_task/spawn.rs.html#151">Source</a><a href="#impl-Spawn-for-Rc%3CSp%3E" class="anchor">§</a><h3 class="code-header">impl&lt;Sp&gt; <a class="trait" href="trait.Spawn.html" title="trait futures_util::task::Spawn">Spawn</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/rc/struct.Rc.html" title="struct alloc::rc::Rc">Rc</a>&lt;Sp&gt;<div class="where">where
Sp: <a class="trait" href="trait.Spawn.html" title="trait futures_util::task::Spawn">Spawn</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><section id="method.spawn_obj-3" class="method trait-impl"><a class="src rightside" href="../../src/futures_task/spawn.rs.html#152">Source</a><a href="#method.spawn_obj-3" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.spawn_obj" class="fn">spawn_obj</a>(&amp;self, future: <a class="struct" href="../future/struct.FutureObj.html" title="struct futures_util::future::FutureObj">FutureObj</a>&lt;'static, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, <a class="struct" href="struct.SpawnError.html" title="struct futures_util::task::SpawnError">SpawnError</a>&gt;</h4></section><section id="method.status-4" class="method trait-impl"><a class="src rightside" href="../../src/futures_task/spawn.rs.html#156">Source</a><a href="#method.status-4" class="anchor">§</a><h4 class="code-header">fn <a href="#method.status" class="fn">status</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, <a class="struct" href="struct.SpawnError.html" title="struct futures_util::task::SpawnError">SpawnError</a>&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Spawn-for-Arc%3CSp%3E" class="impl"><a class="src rightside" href="../../src/futures_task/spawn.rs.html#172">Source</a><a href="#impl-Spawn-for-Arc%3CSp%3E" class="anchor">§</a><h3 class="code-header">impl&lt;Sp&gt; <a class="trait" href="trait.Spawn.html" title="trait futures_util::task::Spawn">Spawn</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;Sp&gt;<div class="where">where
Sp: <a class="trait" href="trait.Spawn.html" title="trait futures_util::task::Spawn">Spawn</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><section id="method.spawn_obj-4" class="method trait-impl"><a class="src rightside" href="../../src/futures_task/spawn.rs.html#173">Source</a><a href="#method.spawn_obj-4" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.spawn_obj" class="fn">spawn_obj</a>(&amp;self, future: <a class="struct" href="../future/struct.FutureObj.html" title="struct futures_util::future::FutureObj">FutureObj</a>&lt;'static, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, <a class="struct" href="struct.SpawnError.html" title="struct futures_util::task::SpawnError">SpawnError</a>&gt;</h4></section><section id="method.status-5" class="method trait-impl"><a class="src rightside" href="../../src/futures_task/spawn.rs.html#177">Source</a><a href="#method.status-5" class="anchor">§</a><h4 class="code-header">fn <a href="#method.status" class="fn">status</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, <a class="struct" href="struct.SpawnError.html" title="struct futures_util::task::SpawnError">SpawnError</a>&gt;</h4></section></div></details><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-Spawn-for-FuturesUnordered%3CFutureObj%3C'_,+()%3E%3E" class="impl"><a class="src rightside" href="../../src/futures_util/stream/futures_unordered/mod.rs.html#68-73">Source</a><a href="#impl-Spawn-for-FuturesUnordered%3CFutureObj%3C'_,+()%3E%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Spawn.html" title="trait futures_util::task::Spawn">Spawn</a> for <a class="struct" href="../stream/struct.FuturesUnordered.html" title="struct futures_util::stream::FuturesUnordered">FuturesUnordered</a>&lt;<a class="struct" href="../future/struct.FutureObj.html" title="struct futures_util::future::FutureObj">FutureObj</a>&lt;'_, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>&gt;&gt;</h3></section></div><script src="../../trait.impl/futures_task/spawn/trait.Spawn.js" data-ignore-extern-crates="alloc" async></script></section></div></main></body></html>

View File

@@ -0,0 +1,51 @@
<!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="Extension trait for `Spawn`."><title>SpawnExt in futures_util::task - 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="futures_util" 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 trait"><!--[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="#">SpawnExt</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../futures_util/index.html">futures_<wbr>util</a><span class="version">0.3.32</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Spawn<wbr>Ext</a></h2><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.spawn" title="spawn">spawn</a></li><li><a href="#method.spawn_with_handle" title="spawn_with_handle">spawn_with_handle</a></li></ul><h3><a href="#dyn-compatibility">Dyn Compatibility</a></h3><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In futures_<wbr>util::<wbr>task</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">futures_util</a>::<wbr><a href="index.html">task</a></div><h1>Trait <span class="trait">Spawn<wbr>Ext</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/futures_util/task/spawn.rs.html#20-100">Source</a> </span></div><pre class="rust item-decl"><code>pub trait SpawnExt: <a class="trait" href="trait.Spawn.html" title="trait futures_util::task::Spawn">Spawn</a> {
// Provided methods
fn <a href="#method.spawn" class="fn">spawn</a>&lt;Fut&gt;(&amp;self, future: Fut) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, <a class="struct" href="struct.SpawnError.html" title="struct futures_util::task::SpawnError">SpawnError</a>&gt;
<span class="where">where Fut: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>&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> + 'static</span> { ... }
<span class="item-spacer"></span> fn <a href="#method.spawn_with_handle" class="fn">spawn_with_handle</a>&lt;Fut&gt;(
&amp;self,
future: Fut,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="../future/struct.RemoteHandle.html" title="struct futures_util::future::RemoteHandle">RemoteHandle</a>&lt;Fut::<a class="associatedtype" href="https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html#associatedtype.Output" title="type core::future::future::Future::Output">Output</a>&gt;, <a class="struct" href="struct.SpawnError.html" title="struct futures_util::task::SpawnError">SpawnError</a>&gt;
<span class="where">where Fut: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a> + <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,
Fut::<a class="associatedtype" href="https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html#associatedtype.Output" title="type core::future::future::Future::Output">Output</a>: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a></span> { ... }
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Extension trait for <code>Spawn</code>.</p>
</div></details><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.spawn" class="method"><a class="src rightside" href="../../src/futures_util/task/spawn.rs.html#49-54">Source</a><h4 class="code-header">fn <a href="#method.spawn" class="fn">spawn</a>&lt;Fut&gt;(&amp;self, future: Fut) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, <a class="struct" href="struct.SpawnError.html" title="struct futures_util::task::SpawnError">SpawnError</a>&gt;<div class="where">where
Fut: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>&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> + 'static,</div></h4></section></summary><div class="docblock"><p>Spawns a task that polls the given future with output <code>()</code> to
completion.</p>
<p>This method returns a <a href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result"><code>Result</code></a> that contains a <a href="struct.SpawnError.html" title="struct futures_util::task::SpawnError"><code>SpawnError</code></a> if
spawning fails.</p>
<p>You can use <a href="trait.SpawnExt.html#method.spawn_with_handle" title="method futures_util::task::SpawnExt::spawn_with_handle"><code>spawn_with_handle</code></a> if
you want to spawn a future with output other than <code>()</code> or if you want
to be able to await its completion.</p>
<p>Note this method will eventually be replaced with the upcoming
<code>Spawn::spawn</code> method which will take a <code>dyn Future</code> as input.
Technical limitations prevent <code>Spawn::spawn</code> from being implemented
today. Feel free to use this method in the meantime.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>futures::executor::ThreadPool;
<span class="kw">use </span>futures::task::SpawnExt;
<span class="kw">let </span>executor = ThreadPool::new().unwrap();
<span class="kw">let </span>future = <span class="kw">async </span>{ <span class="comment">/* ... */ </span>};
executor.spawn(future).unwrap();</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.spawn_with_handle" class="method"><a class="src rightside" href="../../src/futures_util/task/spawn.rs.html#80-88">Source</a><h4 class="code-header">fn <a href="#method.spawn_with_handle" class="fn">spawn_with_handle</a>&lt;Fut&gt;(
&amp;self,
future: Fut,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="../future/struct.RemoteHandle.html" title="struct futures_util::future::RemoteHandle">RemoteHandle</a>&lt;Fut::<a class="associatedtype" href="https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html#associatedtype.Output" title="type core::future::future::Future::Output">Output</a>&gt;, <a class="struct" href="struct.SpawnError.html" title="struct futures_util::task::SpawnError">SpawnError</a>&gt;<div class="where">where
Fut: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a> + <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,
Fut::<a class="associatedtype" href="https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html#associatedtype.Output" title="type core::future::future::Future::Output">Output</a>: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,</div></h4></section></summary><div class="docblock"><p>Spawns a task that polls the given future to completion and returns a
future that resolves to the spawned futures output.</p>
<p>This method returns a <a href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result"><code>Result</code></a> that contains a <a href="../future/struct.RemoteHandle.html" title="struct futures_util::future::RemoteHandle"><code>RemoteHandle</code></a>, or, if
spawning fails, a <a href="struct.SpawnError.html" title="struct futures_util::task::SpawnError"><code>SpawnError</code></a>. <a href="../future/struct.RemoteHandle.html" title="struct futures_util::future::RemoteHandle"><code>RemoteHandle</code></a> is a future that
resolves to the output of the spawned future.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>futures::executor::{block_on, ThreadPool};
<span class="kw">use </span>futures::future;
<span class="kw">use </span>futures::task::SpawnExt;
<span class="kw">let </span>executor = ThreadPool::new().unwrap();
<span class="kw">let </span>future = future::ready(<span class="number">1</span>);
<span class="kw">let </span>join_handle_fut = executor.spawn_with_handle(future).unwrap();
<span class="macro">assert_eq!</span>(block_on(join_handle_fut), <span class="number">1</span>);</code></pre></div></div></details></div><h2 id="dyn-compatibility" class="section-header">Dyn Compatibility<a href="#dyn-compatibility" class="anchor">§</a></h2><div class="dyn-compatibility-info"><p>This trait is <b>not</b> <a href="https://doc.rust-lang.org/1.93.1/reference/items/traits.html#dyn-compatibility">dyn compatible</a>.</p><p><i>In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.</i></p></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-SpawnExt-for-Sp" class="impl"><a class="src rightside" href="../../src/futures_util/task/spawn.rs.html#16">Source</a><a href="#impl-SpawnExt-for-Sp" class="anchor">§</a><h3 class="code-header">impl&lt;Sp&gt; <a class="trait" href="trait.SpawnExt.html" title="trait futures_util::task::SpawnExt">SpawnExt</a> for Sp<div class="where">where
Sp: <a class="trait" href="trait.Spawn.html" title="trait futures_util::task::Spawn">Spawn</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></div><script src="../../trait.impl/futures_util/task/spawn/trait.SpawnExt.js" async></script></section></div></main></body></html>

File diff suppressed because one or more lines are too long