Files
phy/stackfuture/struct.StackFuture.html
Orion Kindel 0ce894e6b0 doc
2025-03-18 10:30:23 -05:00

100 lines
39 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="A wrapper that stores a future in space allocated by the container"><title>StackFuture in stackfuture - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.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" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="stackfuture" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.0 (9fc6b4312 2025-01-07)" data-channel="1.84.0" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../stackfuture/index.html">stackfuture</a><span class="version">0.3.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Stack<wbr>Future</a></h2><h3><a href="#implementations">Methods</a></h3><ul class="block method"><li><a href="#method.from" title="from">from</a></li><li><a href="#method.from_or_box" title="from_or_box">from_or_box</a></li><li><a href="#method.has_alignment_for" title="has_alignment_for">has_alignment_for</a></li><li><a href="#method.has_alignment_for_val" title="has_alignment_for_val">has_alignment_for_val</a></li><li><a href="#method.has_space_for" title="has_space_for">has_space_for</a></li><li><a href="#method.has_space_for_val" title="has_space_for_val">has_space_for_val</a></li><li><a href="#method.try_from" title="try_from">try_from</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-Drop-for-StackFuture%3C'a,+T,+STACK_SIZE%3E" title="Drop">Drop</a></li><li><a href="#impl-Future-for-StackFuture%3C'a,+T,+STACK_SIZE%3E" title="Future">Future</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-RefUnwindSafe-for-StackFuture%3C'a,+T,+STACK_SIZE%3E" title="!RefUnwindSafe">!RefUnwindSafe</a></li><li><a href="#impl-Sync-for-StackFuture%3C'a,+T,+STACK_SIZE%3E" title="!Sync">!Sync</a></li><li><a href="#impl-Unpin-for-StackFuture%3C'a,+T,+STACK_SIZE%3E" title="!Unpin">!Unpin</a></li><li><a href="#impl-UnwindSafe-for-StackFuture%3C'a,+T,+STACK_SIZE%3E" title="!UnwindSafe">!UnwindSafe</a></li><li><a href="#impl-Freeze-for-StackFuture%3C'a,+T,+STACK_SIZE%3E" title="Freeze">Freeze</a></li><li><a href="#impl-Send-for-StackFuture%3C'a,+T,+STACK_SIZE%3E" title="Send">Send</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block blanket-implementation"><li><a href="#impl-Any-for-T" title="Any">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-T" title="Borrow&#60;T&#62;">Borrow&#60;T&#62;</a></li><li><a href="#impl-BorrowMut%3CT%3E-for-T" title="BorrowMut&#60;T&#62;">BorrowMut&#60;T&#62;</a></li><li><a href="#impl-From%3CT%3E-for-T" title="From&#60;T&#62;">From&#60;T&#62;</a></li><li><a href="#impl-Into%3CU%3E-for-T" title="Into&#60;U&#62;">Into&#60;U&#62;</a></li><li><a href="#impl-IntoFuture-for-F" title="IntoFuture">IntoFuture</a></li><li><a href="#impl-TryFrom%3CU%3E-for-T" title="TryFrom&#60;U&#62;">TryFrom&#60;U&#62;</a></li><li><a href="#impl-TryInto%3CU%3E-for-T" title="TryInto&#60;U&#62;">TryInto&#60;U&#62;</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate stackfuture</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="index.html">stackfuture</a></span><h1>Struct <span class="struct">StackFuture</span><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/stackfuture/lib.rs.html#78-94">Source</a> </span></div><pre class="rust item-decl"><code><div class="code-attribute">#[repr(C)]</div>pub struct StackFuture&lt;'a, T, const STACK_SIZE: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/core/primitive.usize.html">usize</a>&gt; { <span class="comment">/* private fields */</span> }</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A wrapper that stores a future in space allocated by the container</p>
<p>Often this space comes from the calling functions stack, but it could just
as well come from some other allocation.</p>
<p>A <code>StackFuture</code> can be used to emulate async functions in dyn Trait objects.
For example:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">trait </span>PseudoAsyncTrait {
<span class="kw">fn </span>do_something(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; StackFuture&lt;<span class="lifetime">'_</span>, (), { <span class="number">512 </span>}&gt;;
}
<span class="kw">impl </span>PseudoAsyncTrait <span class="kw">for </span>i32 {
<span class="kw">fn </span>do_something(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; StackFuture&lt;<span class="lifetime">'_</span>, (), { <span class="number">512 </span>}&gt; {
StackFuture::from(<span class="kw">async </span>{
<span class="comment">// function body goes here
</span>})
}
}
<span class="kw">async fn </span>use_dyn_async_trait(x: <span class="kw-2">&amp;</span><span class="kw">dyn </span>PseudoAsyncTrait) {
x.do_something().<span class="kw">await</span>;
}
<span class="kw">async fn </span>call_with_dyn_async_trait() {
use_dyn_async_trait(<span class="kw-2">&amp;</span><span class="number">42</span>).<span class="kw">await</span>;
}</code></pre></div>
<p>This example defines <code>PseudoAsyncTrait</code> with a single method <code>do_something</code>.
The <code>do_something</code> method can be called as if it were declared as
<code>async fn do_something(&amp;self)</code>. To implement <code>do_something</code>, the easiest thing
to do is to wrap the body of the function in <code>StackFuture::from(async { ... })</code>,
which creates an anonymous future for the body and stores it in a <code>StackFuture</code>.</p>
<p>Because <code>StackFuture</code> does not know the size of the future it wraps, the maximum
size of the future must be specified in the <code>STACK_SIZE</code> parameter. In the example
here, weve used a stack size of 512, which is probably much larger than necessary
but would accommodate many futures besides the simple one weve shown here.</p>
<p><code>StackFuture</code> ensures when wrapping a future that enough space is available, and
it also respects any alignment requirements for the wrapped future. Note that the
wrapped futures alignment must be less than or equal to that of the overall
<code>StackFuture</code> struct.</p>
</div></details><h2 id="implementations" class="section-header">Implementations<a href="#implementations" class="anchor">§</a></h2><div id="implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-StackFuture%3C'a,+T,+STACK_SIZE%3E" class="impl"><a class="src rightside" href="../src/stackfuture/lib.rs.html#96-277">Source</a><a href="#impl-StackFuture%3C'a,+T,+STACK_SIZE%3E" class="anchor">§</a><h3 class="code-header">impl&lt;'a, T, const STACK_SIZE: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/core/primitive.usize.html">usize</a>&gt; <a class="struct" href="struct.StackFuture.html" title="struct stackfuture::StackFuture">StackFuture</a>&lt;'a, T, STACK_SIZE&gt;</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from" class="method"><a class="src rightside" href="../src/stackfuture/lib.rs.html#135-153">Source</a><h4 class="code-header">pub fn <a href="#method.from" class="fn">from</a>&lt;F&gt;(future: F) -&gt; Self<div class="where">where
F: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = T&gt; + <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'a,</div></h4></section></summary><div class="docblock"><p>Creates a <code>StackFuture</code> from an existing future</p>
<p>See the documentation on <a href="struct.StackFuture.html" title="struct stackfuture::StackFuture"><code>StackFuture</code></a> for examples of how to use this.</p>
<p>The size and alignment requirements are statically checked, so it is a compiler error
to use this with a future that does not fit within the <a href="struct.StackFuture.html" title="struct stackfuture::StackFuture"><code>StackFuture</code></a>s size and
alignment requirements.</p>
<p>The following example illustrates a compile error for a future that is too large.</p>
<div class="example-wrap compile_fail"><a href="#" class="tooltip" title="This example deliberately fails to compile"></a><pre class="rust rust-example-rendered"><code><span class="comment">// Fails because the future contains a large array and is therefore too big to fit in
// a 16-byte `StackFuture`.
</span><span class="kw">let </span>f = StackFuture::&lt;<span class="kw">_</span>, { <span class="number">16 </span>}&gt;::from(<span class="kw">async </span>{
<span class="kw">let </span>x = [<span class="number">0u8</span>; <span class="number">4096</span>];
<span class="kw">async </span>{}.<span class="kw">await</span>;
<span class="macro">println!</span>(<span class="string">"{}"</span>, x.len());
});</code></pre></div>
<p>The example below illustrates a compiler error for a future whose alignment is too large.</p>
<div class="example-wrap compile_fail"><a href="#" class="tooltip" title="This example deliberately fails to compile"></a><pre class="rust rust-example-rendered"><code>
<span class="attr">#[derive(Debug)]
#[repr(align(<span class="number">256</span>))]
</span><span class="kw">struct </span>BigAlignment(usize);
<span class="comment">// Fails because the future contains a large array and is therefore too big to fit in
// a 16-byte `StackFuture`.
</span><span class="kw">let </span>f = StackFuture::&lt;<span class="kw">_</span>, { <span class="number">16 </span>}&gt;::from(<span class="kw">async </span>{
<span class="kw">let </span>x = BigAlignment(<span class="number">42</span>);
<span class="kw">async </span>{}.<span class="kw">await</span>;
<span class="macro">println!</span>(<span class="string">"{x:?}"</span>);
});</code></pre></div>
</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from" class="method"><a class="src rightside" href="../src/stackfuture/lib.rs.html#163-192">Source</a><h4 class="code-header">pub fn <a href="#method.try_from" class="fn">try_from</a>&lt;F&gt;(future: F) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self, <a class="struct" href="struct.IntoStackFutureError.html" title="struct stackfuture::IntoStackFutureError">IntoStackFutureError</a>&lt;F&gt;&gt;<div class="where">where
F: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = T&gt; + <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'a,</div></h4></section></summary><div class="docblock"><p>Attempts to create a <code>StackFuture</code> from an existing future</p>
<p>If the <code>StackFuture</code> is not large enough to hold <code>future</code>, this function returns an
<code>Err</code> with the argument <code>future</code> returned to you.</p>
<p>Panics</p>
<p>If we cannot satisfy the alignment requirements for <code>F</code>, this function will panic.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.from_or_box" class="method"><a class="src rightside" href="../src/stackfuture/lib.rs.html#205-210">Source</a><h4 class="code-header">pub fn <a href="#method.from_or_box" class="fn">from_or_box</a>&lt;F&gt;(future: F) -&gt; Self<div class="where">where
F: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = T&gt; + <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'a,</div></h4></section></summary><div class="docblock"><p>Creates a StackFuture from the given future, boxing if necessary</p>
<p>This version will succeed even if the future is larger than <code>STACK_SIZE</code>. If the future
is too large, <code>from_or_box</code> will allocate a <code>Box</code> on the heap and store the resulting
boxed future in the <code>StackFuture</code>.</p>
<p>The same thing also happens if the wrapped futures alignment is larger than StackFutures
alignment.</p>
<p>This function requires the “alloc” crate feature.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.has_space_for" class="method"><a class="src rightside" href="../src/stackfuture/lib.rs.html#257-259">Source</a><h4 class="code-header">pub const fn <a href="#method.has_space_for" class="fn">has_space_for</a>&lt;F&gt;() -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.0/core/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Determines whether this <code>StackFuture</code> can hold a value of type <code>F</code></p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.has_space_for_val" class="method"><a class="src rightside" href="../src/stackfuture/lib.rs.html#262-264">Source</a><h4 class="code-header">pub const fn <a href="#method.has_space_for_val" class="fn">has_space_for_val</a>&lt;F&gt;(_: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/core/primitive.reference.html">&amp;F</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.0/core/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Determines whether this <code>StackFuture</code> can hold the referenced value</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.has_alignment_for" class="method"><a class="src rightside" href="../src/stackfuture/lib.rs.html#268-270">Source</a><h4 class="code-header">pub const fn <a href="#method.has_alignment_for" class="fn">has_alignment_for</a>&lt;F&gt;() -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.0/core/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Determines whether this <code>StackFuture</code>s alignment is compatible with the
type <code>F</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.has_alignment_for_val" class="method"><a class="src rightside" href="../src/stackfuture/lib.rs.html#274-276">Source</a><h4 class="code-header">pub const fn <a href="#method.has_alignment_for_val" class="fn">has_alignment_for_val</a>&lt;F&gt;(_: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/core/primitive.reference.html">&amp;F</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.0/core/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Determines whether this <code>StackFuture</code>s alignment is compatible with the
referenced value.</p>
</div></details></div></details></div><h2 id="trait-implementations" class="section-header">Trait Implementations<a href="#trait-implementations" class="anchor">§</a></h2><div id="trait-implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-Drop-for-StackFuture%3C'a,+T,+STACK_SIZE%3E" class="impl"><a class="src rightside" href="../src/stackfuture/lib.rs.html#296-300">Source</a><a href="#impl-Drop-for-StackFuture%3C'a,+T,+STACK_SIZE%3E" class="anchor">§</a><h3 class="code-header">impl&lt;'a, T, const STACK_SIZE: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/core/primitive.usize.html">usize</a>&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/ops/drop/trait.Drop.html" title="trait core::ops::drop::Drop">Drop</a> for <a class="struct" href="struct.StackFuture.html" title="struct stackfuture::StackFuture">StackFuture</a>&lt;'a, T, STACK_SIZE&gt;</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.drop" class="method trait-impl"><a class="src rightside" href="../src/stackfuture/lib.rs.html#297-299">Source</a><a href="#method.drop" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/ops/drop/trait.Drop.html#tymethod.drop" class="fn">drop</a>(&amp;mut self)</h4></section></summary><div class='docblock'>Executes the destructor for this type. <a href="https://doc.rust-lang.org/1.84.0/core/ops/drop/trait.Drop.html#tymethod.drop">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Future-for-StackFuture%3C'a,+T,+STACK_SIZE%3E" class="impl"><a class="src rightside" href="../src/stackfuture/lib.rs.html#279-294">Source</a><a href="#impl-Future-for-StackFuture%3C'a,+T,+STACK_SIZE%3E" class="anchor">§</a><h3 class="code-header">impl&lt;'a, T, const STACK_SIZE: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/core/primitive.usize.html">usize</a>&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a> for <a class="struct" href="struct.StackFuture.html" title="struct stackfuture::StackFuture">StackFuture</a>&lt;'a, T, STACK_SIZE&gt;</h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Output" class="associatedtype trait-impl"><a class="src rightside" href="../src/stackfuture/lib.rs.html#280">Source</a><a href="#associatedtype.Output" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.0/core/future/future/trait.Future.html#associatedtype.Output" class="associatedtype">Output</a> = T</h4></section></summary><div class='docblock'>The type of value produced on completion.</div></details><details class="toggle method-toggle" open><summary><section id="method.poll" class="method trait-impl"><a class="src rightside" href="../src/stackfuture/lib.rs.html#282-293">Source</a><a href="#method.poll" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/future/future/trait.Future.html#tymethod.poll" class="fn">poll</a>(self: <a class="struct" href="https://doc.rust-lang.org/1.84.0/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;&amp;mut Self&gt;, cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.84.0/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;Self::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.0/core/future/future/trait.Future.html#associatedtype.Output" title="type core::future::future::Future::Output">Output</a>&gt;</h4></section></summary><div class='docblock'>Attempts to resolve the future to a final value, registering
the current task for wakeup if the value is not yet available. <a href="https://doc.rust-lang.org/1.84.0/core/future/future/trait.Future.html#tymethod.poll">Read more</a></div></details></div></details></div><h2 id="synthetic-implementations" class="section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor">§</a></h2><div id="synthetic-implementations-list"><section id="impl-Freeze-for-StackFuture%3C'a,+T,+STACK_SIZE%3E" class="impl"><a href="#impl-Freeze-for-StackFuture%3C'a,+T,+STACK_SIZE%3E" class="anchor">§</a><h3 class="code-header">impl&lt;'a, T, const STACK_SIZE: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/core/primitive.usize.html">usize</a>&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Freeze.html" title="trait core::marker::Freeze">Freeze</a> for <a class="struct" href="struct.StackFuture.html" title="struct stackfuture::StackFuture">StackFuture</a>&lt;'a, T, STACK_SIZE&gt;</h3></section><section id="impl-RefUnwindSafe-for-StackFuture%3C'a,+T,+STACK_SIZE%3E" class="impl"><a href="#impl-RefUnwindSafe-for-StackFuture%3C'a,+T,+STACK_SIZE%3E" class="anchor">§</a><h3 class="code-header">impl&lt;'a, T, const STACK_SIZE: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/core/primitive.usize.html">usize</a>&gt; !<a class="trait" href="https://doc.rust-lang.org/1.84.0/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.StackFuture.html" title="struct stackfuture::StackFuture">StackFuture</a>&lt;'a, T, STACK_SIZE&gt;</h3></section><section id="impl-Send-for-StackFuture%3C'a,+T,+STACK_SIZE%3E" class="impl"><a href="#impl-Send-for-StackFuture%3C'a,+T,+STACK_SIZE%3E" class="anchor">§</a><h3 class="code-header">impl&lt;'a, T, const STACK_SIZE: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/core/primitive.usize.html">usize</a>&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.StackFuture.html" title="struct stackfuture::StackFuture">StackFuture</a>&lt;'a, T, STACK_SIZE&gt;</h3></section><section id="impl-Sync-for-StackFuture%3C'a,+T,+STACK_SIZE%3E" class="impl"><a href="#impl-Sync-for-StackFuture%3C'a,+T,+STACK_SIZE%3E" class="anchor">§</a><h3 class="code-header">impl&lt;'a, T, const STACK_SIZE: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/core/primitive.usize.html">usize</a>&gt; !<a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.StackFuture.html" title="struct stackfuture::StackFuture">StackFuture</a>&lt;'a, T, STACK_SIZE&gt;</h3></section><section id="impl-Unpin-for-StackFuture%3C'a,+T,+STACK_SIZE%3E" class="impl"><a href="#impl-Unpin-for-StackFuture%3C'a,+T,+STACK_SIZE%3E" class="anchor">§</a><h3 class="code-header">impl&lt;'a, T, const STACK_SIZE: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/core/primitive.usize.html">usize</a>&gt; !<a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.StackFuture.html" title="struct stackfuture::StackFuture">StackFuture</a>&lt;'a, T, STACK_SIZE&gt;</h3></section><section id="impl-UnwindSafe-for-StackFuture%3C'a,+T,+STACK_SIZE%3E" class="impl"><a href="#impl-UnwindSafe-for-StackFuture%3C'a,+T,+STACK_SIZE%3E" class="anchor">§</a><h3 class="code-header">impl&lt;'a, T, const STACK_SIZE: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/core/primitive.usize.html">usize</a>&gt; !<a class="trait" href="https://doc.rust-lang.org/1.84.0/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.StackFuture.html" title="struct stackfuture::StackFuture">StackFuture</a>&lt;'a, T, STACK_SIZE&gt;</h3></section></div><h2 id="blanket-implementations" class="section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor">§</a></h2><div id="blanket-implementations-list"><details class="toggle implementors-toggle"><summary><section id="impl-Any-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/any.rs.html#138">Source</a><a href="#impl-Any-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T<div class="where">where
T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/any.rs.html#139">Source</a><a href="#method.type_id" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/any/trait.Any.html#tymethod.type_id" class="fn">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.84.0/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></section></summary><div class='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.84.0/core/any/trait.Any.html#tymethod.type_id">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/borrow.rs.html#209">Source</a><a href="#impl-Borrow%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T<div class="where">where
T: ?<a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/borrow.rs.html#211">Source</a><a href="#method.borrow" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/borrow/trait.Borrow.html#tymethod.borrow" class="fn">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.0/core/primitive.reference.html">&amp;T</a></h4></section></summary><div class='docblock'>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.84.0/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/borrow.rs.html#217">Source</a><a href="#impl-BorrowMut%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T<div class="where">where
T: ?<a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/borrow.rs.html#218">Source</a><a href="#method.borrow_mut" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fn">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.0/core/primitive.reference.html">&amp;mut T</a></h4></section></summary><div class='docblock'>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.84.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-From%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#765">Source</a><a href="#impl-From%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from-1" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#768">Source</a><a href="#method.from-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(t: T) -&gt; T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#748-750">Source</a><a href="#impl-Into%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T<div class="where">where
U: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#758">Source</a><a href="#method.into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/convert/trait.Into.html#tymethod.into" class="fn">into</a>(self) -&gt; U</h4></section></summary><div class="docblock"><p>Calls <code>U::from(self)</code>.</p>
<p>That is, this conversion is whatever the implementation of
<code><a href="https://doc.rust-lang.org/1.84.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for U</code> chooses to do.</p>
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-IntoFuture-for-F" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/future/into_future.rs.html#138">Source</a><a href="#impl-IntoFuture-for-F" class="anchor">§</a><h3 class="code-header">impl&lt;F&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/future/into_future/trait.IntoFuture.html" title="trait core::future::into_future::IntoFuture">IntoFuture</a> for F<div class="where">where
F: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Output-1" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/future/into_future.rs.html#139">Source</a><a href="#associatedtype.Output-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.0/core/future/into_future/trait.IntoFuture.html#associatedtype.Output" class="associatedtype">Output</a> = &lt;F as <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.0/core/future/future/trait.Future.html#associatedtype.Output" title="type core::future::future::Future::Output">Output</a></h4></section></summary><div class='docblock'>The output that the future will produce on completion.</div></details><details class="toggle" open><summary><section id="associatedtype.IntoFuture" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/future/into_future.rs.html#140">Source</a><a href="#associatedtype.IntoFuture" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.0/core/future/into_future/trait.IntoFuture.html#associatedtype.IntoFuture" class="associatedtype">IntoFuture</a> = F</h4></section></summary><div class='docblock'>Which kind of future are we turning this into?</div></details><details class="toggle method-toggle" open><summary><section id="method.into_future" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/future/into_future.rs.html#142">Source</a><a href="#method.into_future" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/future/into_future/trait.IntoFuture.html#tymethod.into_future" class="fn">into_future</a>(self) -&gt; &lt;F as <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/future/into_future/trait.IntoFuture.html" title="trait core::future::into_future::IntoFuture">IntoFuture</a>&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.0/core/future/into_future/trait.IntoFuture.html#associatedtype.IntoFuture" title="type core::future::into_future::IntoFuture::IntoFuture">IntoFuture</a></h4></section></summary><div class='docblock'>Creates a future from a value. <a href="https://doc.rust-lang.org/1.84.0/core/future/into_future/trait.IntoFuture.html#tymethod.into_future">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#805-807">Source</a><a href="#impl-TryFrom%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T<div class="where">where
U: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-1" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#809">Source</a><a href="#associatedtype.Error-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-1" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#812">Source</a><a href="#method.try_from-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#790-792">Source</a><a href="#impl-TryInto%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T<div class="where">where
U: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#794">Source</a><a href="#associatedtype.Error" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#797">Source</a><a href="#method.try_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryInto.html#tymethod.try_into" class="fn">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details></div></section></div></main></body></html>