Files
rapr-rs/docs/futures_util/future/index.html
T
2021-03-14 20:06:11 +00:00

94 lines
23 KiB
HTML
Raw 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="API documentation for the Rust `future` mod in crate `futures_util`."><meta name="keywords" content="rust, rustlang, rust-lang, future"><title>futures_util::future - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../../futures_util/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Module future</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#reexports">Re-exports</a></li><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#traits">Traits</a></li><li><a href="#functions">Functions</a></li></ul></div><p class="location"><a href="../index.html">futures_util</a></p><script>window.sidebarCurrent = {name: "future", ty: "mod", relpath: "../"};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../src/futures_util/future/mod.rs.html#1-125" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../index.html">futures_util</a>::<wbr><a class="mod" href="">future</a></span></h1><div class="docblock"><p>Asynchronous values.</p>
<p>This module contains:</p>
<ul>
<li>The <a href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="Future"><code>Future</code></a> trait.</li>
<li>The <a href="../../futures_util/future/trait.FutureExt.html" title="FutureExt"><code>FutureExt</code></a> and <a href="../../futures_util/future/trait.TryFutureExt.html" title="TryFutureExt"><code>TryFutureExt</code></a> trait, which provides adapters for
chaining and composing futures.</li>
<li>Top-level future combinators like <a href="../../futures_util/future/fn.lazy.html"><code>lazy</code></a> which creates a future
from a closure that defines its return value, and <a href="../../futures_util/future/fn.ready.html"><code>ready</code></a>,
which constructs a future with an immediate defined value.</li>
</ul>
</div><h2 id="reexports" class="section-header"><a href="#reexports">Re-exports</a></h2>
<table><tr><td><code>pub use core::future::<a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>;</code></td></tr></table><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
<table><tr class="module-item"><td><a class="struct" href="struct.AndThen.html" title="futures_util::future::AndThen struct">AndThen</a></td><td class="docblock-short"><p>Future for the <a href="../../futures_util/future/trait.TryFutureExt.html#method.and_then"><code>and_then</code></a> method.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.ErrInto.html" title="futures_util::future::ErrInto struct">ErrInto</a></td><td class="docblock-short"><p>Future for the <a href="../../futures_util/future/trait.TryFutureExt.html#method.err_into"><code>err_into</code></a> method.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.Flatten.html" title="futures_util::future::Flatten struct">Flatten</a></td><td class="docblock-short"><p>Future for the <a href="../../futures_util/future/trait.FutureExt.html#method.flatten"><code>flatten</code></a> method.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.FlattenStream.html" title="futures_util::future::FlattenStream struct">FlattenStream</a></td><td class="docblock-short"><p>Stream for the <a href="../../futures_util/future/trait.FutureExt.html#method.flatten_stream"><code>flatten_stream</code></a> method.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.Fuse.html" title="futures_util::future::Fuse struct">Fuse</a></td><td class="docblock-short"><p>Future for the <a href="../../futures_util/future/trait.FutureExt.html#method.fuse"><code>fuse</code></a> method.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.FutureObj.html" title="futures_util::future::FutureObj struct">FutureObj</a></td><td class="docblock-short"><p>A custom trait object for polling futures, roughly akin to
<code>Box&lt;dyn Future&lt;Output = T&gt; + Send + 'a&gt;</code>.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.Inspect.html" title="futures_util::future::Inspect struct">Inspect</a></td><td class="docblock-short"><p>Future for the <a href="../../futures_util/future/trait.FutureExt.html#method.inspect"><code>inspect</code></a> method.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.InspectErr.html" title="futures_util::future::InspectErr struct">InspectErr</a></td><td class="docblock-short"><p>Future for the <a href="../../futures_util/future/trait.TryFutureExt.html#method.inspect_err"><code>inspect_err</code></a> method.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.InspectOk.html" title="futures_util::future::InspectOk struct">InspectOk</a></td><td class="docblock-short"><p>Future for the <a href="../../futures_util/future/trait.TryFutureExt.html#method.inspect_ok"><code>inspect_ok</code></a> method.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.IntoFuture.html" title="futures_util::future::IntoFuture struct">IntoFuture</a></td><td class="docblock-short"><p>Future for the <a href="../../futures_util/future/trait.TryFutureExt.html#method.into_future"><code>into_future</code></a> method.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.IntoStream.html" title="futures_util::future::IntoStream struct">IntoStream</a></td><td class="docblock-short"><p>Stream for the <a href="../../futures_util/future/trait.FutureExt.html#method.into_stream"><code>into_stream</code></a> method.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.Join.html" title="futures_util::future::Join struct">Join</a></td><td class="docblock-short"><p>Future for the <a href="../../futures_util/future/fn.join.html"><code>join</code></a> function.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.Join3.html" title="futures_util::future::Join3 struct">Join3</a></td><td class="docblock-short"><p>Future for the <a href="../../futures_util/future/fn.join3.html" title="join3"><code>join3</code></a> function.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.Join4.html" title="futures_util::future::Join4 struct">Join4</a></td><td class="docblock-short"><p>Future for the <a href="../../futures_util/future/fn.join4.html" title="join4"><code>join4</code></a> function.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.Join5.html" title="futures_util::future::Join5 struct">Join5</a></td><td class="docblock-short"><p>Future for the <a href="../../futures_util/future/fn.join5.html" title="join5"><code>join5</code></a> function.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.Lazy.html" title="futures_util::future::Lazy struct">Lazy</a></td><td class="docblock-short"><p>Future for the <a href="../../futures_util/future/fn.lazy.html" title="lazy"><code>lazy</code></a> function.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.LocalFutureObj.html" title="futures_util::future::LocalFutureObj struct">LocalFutureObj</a></td><td class="docblock-short"><p>A custom trait object for polling futures, roughly akin to
<code>Box&lt;dyn Future&lt;Output = T&gt; + 'a&gt;</code>.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.Map.html" title="futures_util::future::Map struct">Map</a></td><td class="docblock-short"><p>Future for the <a href="../../futures_util/future/trait.FutureExt.html#method.map"><code>map</code></a> method.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.MapErr.html" title="futures_util::future::MapErr struct">MapErr</a></td><td class="docblock-short"><p>Future for the <a href="../../futures_util/future/trait.TryFutureExt.html#method.map_err"><code>map_err</code></a> method.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.MapInto.html" title="futures_util::future::MapInto struct">MapInto</a></td><td class="docblock-short"><p>Future for the <a href="../../futures_util/future/trait.FutureExt.html#method.map_into"><code>map_into</code></a> combinator.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.MapOk.html" title="futures_util::future::MapOk struct">MapOk</a></td><td class="docblock-short"><p>Future for the <a href="../../futures_util/future/trait.TryFutureExt.html#method.map_ok"><code>map_ok</code></a> method.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.MapOkOrElse.html" title="futures_util::future::MapOkOrElse struct">MapOkOrElse</a></td><td class="docblock-short"><p>Future for the <a href="../../futures_util/future/trait.TryFutureExt.html#method.map_ok_or_else"><code>map_ok_or_else</code></a> method.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.NeverError.html" title="futures_util::future::NeverError struct">NeverError</a></td><td class="docblock-short"><p>Future for the <a href="../../futures_util/future/trait.FutureExt.html#method.never_error"><code>never_error</code></a> combinator.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.OkInto.html" title="futures_util::future::OkInto struct">OkInto</a></td><td class="docblock-short"><p>Future for the <a href="../../futures_util/future/trait.TryFutureExt.html#method.ok_into"><code>ok_into</code></a> method.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.OptionFuture.html" title="futures_util::future::OptionFuture struct">OptionFuture</a></td><td class="docblock-short"><p>A future representing a value which may or may not be present.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.OrElse.html" title="futures_util::future::OrElse struct">OrElse</a></td><td class="docblock-short"><p>Future for the <a href="../../futures_util/future/trait.TryFutureExt.html#method.or_else"><code>or_else</code></a> method.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.Pending.html" title="futures_util::future::Pending struct">Pending</a></td><td class="docblock-short"><p>Future for the <a href="../../futures_util/future/fn.pending.html" title="pending()"><code>pending()</code></a> function.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.PollFn.html" title="futures_util::future::PollFn struct">PollFn</a></td><td class="docblock-short"><p>Future for the <a href="../../futures_util/future/fn.poll_fn.html" title="poll_fn"><code>poll_fn</code></a> function.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.Ready.html" title="futures_util::future::Ready struct">Ready</a></td><td class="docblock-short"><p>Future for the <a href="../../futures_util/future/fn.ready.html"><code>ready</code></a> function.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.Select.html" title="futures_util::future::Select struct">Select</a></td><td class="docblock-short"><p>Future for the <a href="../../futures_util/future/fn.select.html" title="select()"><code>select()</code></a> function.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.Then.html" title="futures_util::future::Then struct">Then</a></td><td class="docblock-short"><p>Future for the <a href="../../futures_util/future/trait.FutureExt.html#method.then"><code>then</code></a> method.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.TryFlatten.html" title="futures_util::future::TryFlatten struct">TryFlatten</a></td><td class="docblock-short"><p>Future for the <a href="../../futures_util/future/trait.TryFutureExt.html#method.try_flatten"><code>try_flatten</code></a> method.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.TryFlattenStream.html" title="futures_util::future::TryFlattenStream struct">TryFlattenStream</a></td><td class="docblock-short"><p>Future for the <a href="../../futures_util/future/trait.TryFutureExt.html#method.try_flatten_stream"><code>try_flatten_stream</code></a> method.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.TryJoin.html" title="futures_util::future::TryJoin struct">TryJoin</a></td><td class="docblock-short"><p>Future for the <a href="../../futures_util/future/fn.try_join.html"><code>try_join</code></a> function.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.TryJoin3.html" title="futures_util::future::TryJoin3 struct">TryJoin3</a></td><td class="docblock-short"><p>Future for the <a href="../../futures_util/future/fn.try_join3.html" title="try_join3"><code>try_join3</code></a> function.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.TryJoin4.html" title="futures_util::future::TryJoin4 struct">TryJoin4</a></td><td class="docblock-short"><p>Future for the <a href="../../futures_util/future/fn.try_join4.html" title="try_join4"><code>try_join4</code></a> function.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.TryJoin5.html" title="futures_util::future::TryJoin5 struct">TryJoin5</a></td><td class="docblock-short"><p>Future for the <a href="../../futures_util/future/fn.try_join5.html" title="try_join5"><code>try_join5</code></a> function.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.TrySelect.html" title="futures_util::future::TrySelect struct">TrySelect</a></td><td class="docblock-short"><p>Future for the <a href="../../futures_util/future/fn.try_select.html" title="try_select()"><code>try_select()</code></a> function.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.UnitError.html" title="futures_util::future::UnitError struct">UnitError</a></td><td class="docblock-short"><p>Future for the <a href="../../futures_util/future/trait.FutureExt.html#method.unit_error"><code>unit_error</code></a> combinator.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.UnwrapOrElse.html" title="futures_util::future::UnwrapOrElse struct">UnwrapOrElse</a></td><td class="docblock-short"><p>Future for the <a href="../../futures_util/future/trait.TryFutureExt.html#method.unwrap_or_else"><code>unwrap_or_else</code></a> method.</p>
</td></tr></table><h2 id="enums" class="section-header"><a href="#enums">Enums</a></h2>
<table><tr class="module-item"><td><a class="enum" href="enum.Either.html" title="futures_util::future::Either enum">Either</a></td><td class="docblock-short"><p>Combines two different futures, streams, or sinks having the same associated types into a single
type.</p>
</td></tr><tr class="module-item"><td><a class="enum" href="enum.MaybeDone.html" title="futures_util::future::MaybeDone enum">MaybeDone</a></td><td class="docblock-short"><p>A future that may have completed.</p>
</td></tr><tr class="module-item"><td><a class="enum" href="enum.TryMaybeDone.html" title="futures_util::future::TryMaybeDone enum">TryMaybeDone</a></td><td class="docblock-short"><p>A future that may have completed with an error.</p>
</td></tr></table><h2 id="traits" class="section-header"><a href="#traits">Traits</a></h2>
<table><tr class="module-item"><td><a class="trait" href="trait.FusedFuture.html" title="futures_util::future::FusedFuture trait">FusedFuture</a></td><td class="docblock-short"><p>A future which tracks whether or not the underlying future
should no longer be polled.</p>
</td></tr><tr class="module-item"><td><a class="trait" href="trait.FutureExt.html" title="futures_util::future::FutureExt trait">FutureExt</a></td><td class="docblock-short"><p>An extension trait for <code>Future</code>s that provides a variety of convenient
adapters.</p>
</td></tr><tr class="module-item"><td><a class="trait" href="trait.TryFuture.html" title="futures_util::future::TryFuture trait">TryFuture</a></td><td class="docblock-short"><p>A convenience for futures that return <code>Result</code> values that includes
a variety of adapters tailored to such futures.</p>
</td></tr><tr class="module-item"><td><a class="trait" href="trait.TryFutureExt.html" title="futures_util::future::TryFutureExt trait">TryFutureExt</a></td><td class="docblock-short"><p>Adapters specific to <a href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="Result"><code>Result</code></a>-returning futures</p>
</td></tr><tr class="module-item"><td><a class="trait" href="trait.UnsafeFutureObj.html" title="futures_util::future::UnsafeFutureObj trait">UnsafeFutureObj</a></td><td class="docblock-short"><p>A custom implementation of a future trait object for <code>FutureObj</code>, providing
a vtable with drop support.</p>
</td></tr></table><h2 id="functions" class="section-header"><a href="#functions">Functions</a></h2>
<table><tr class="module-item"><td><a class="fn" href="fn.err.html" title="futures_util::future::err fn">err</a></td><td class="docblock-short"><p>Create a future that is immediately ready with an error value.</p>
</td></tr><tr class="module-item"><td><a class="fn" href="fn.join.html" title="futures_util::future::join fn">join</a></td><td class="docblock-short"><p>Joins the result of two futures, waiting for them both to complete.</p>
</td></tr><tr class="module-item"><td><a class="fn" href="fn.join3.html" title="futures_util::future::join3 fn">join3</a></td><td class="docblock-short"><p>Same as <a href="../../futures_util/future/fn.join.html"><code>join</code></a>, but with more futures.</p>
</td></tr><tr class="module-item"><td><a class="fn" href="fn.join4.html" title="futures_util::future::join4 fn">join4</a></td><td class="docblock-short"><p>Same as <a href="../../futures_util/future/fn.join.html"><code>join</code></a>, but with more futures.</p>
</td></tr><tr class="module-item"><td><a class="fn" href="fn.join5.html" title="futures_util::future::join5 fn">join5</a></td><td class="docblock-short"><p>Same as <a href="../../futures_util/future/fn.join.html"><code>join</code></a>, but with more futures.</p>
</td></tr><tr class="module-item"><td><a class="fn" href="fn.lazy.html" title="futures_util::future::lazy fn">lazy</a></td><td class="docblock-short"><p>Creates a new future that allows delayed execution of a closure.</p>
</td></tr><tr class="module-item"><td><a class="fn" href="fn.maybe_done.html" title="futures_util::future::maybe_done fn">maybe_done</a></td><td class="docblock-short"><p>Wraps a future into a <code>MaybeDone</code></p>
</td></tr><tr class="module-item"><td><a class="fn" href="fn.ok.html" title="futures_util::future::ok fn">ok</a></td><td class="docblock-short"><p>Create a future that is immediately ready with a success value.</p>
</td></tr><tr class="module-item"><td><a class="fn" href="fn.pending.html" title="futures_util::future::pending fn">pending</a></td><td class="docblock-short"><p>Creates a future which never resolves, representing a computation that never
finishes.</p>
</td></tr><tr class="module-item"><td><a class="fn" href="fn.poll_fn.html" title="futures_util::future::poll_fn fn">poll_fn</a></td><td class="docblock-short"><p>Creates a new future wrapping around a function returning <a href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="Poll"><code>Poll</code></a>.</p>
</td></tr><tr class="module-item"><td><a class="fn" href="fn.ready.html" title="futures_util::future::ready fn">ready</a></td><td class="docblock-short"><p>Creates a future that is immediately ready with a value.</p>
</td></tr><tr class="module-item"><td><a class="fn" href="fn.select.html" title="futures_util::future::select fn">select</a></td><td class="docblock-short"><p>Waits for either one of two differently-typed futures to complete.</p>
</td></tr><tr class="module-item"><td><a class="fn" href="fn.try_join.html" title="futures_util::future::try_join fn">try_join</a></td><td class="docblock-short"><p>Joins the result of two futures, waiting for them both to complete or
for one to produce an error.</p>
</td></tr><tr class="module-item"><td><a class="fn" href="fn.try_join3.html" title="futures_util::future::try_join3 fn">try_join3</a></td><td class="docblock-short"><p>Same as <a href="../../futures_util/future/fn.try_join.html"><code>try_join</code></a>, but with more futures.</p>
</td></tr><tr class="module-item"><td><a class="fn" href="fn.try_join4.html" title="futures_util::future::try_join4 fn">try_join4</a></td><td class="docblock-short"><p>Same as <a href="../../futures_util/future/fn.try_join.html"><code>try_join</code></a>, but with more futures.</p>
</td></tr><tr class="module-item"><td><a class="fn" href="fn.try_join5.html" title="futures_util::future::try_join5 fn">try_join5</a></td><td class="docblock-short"><p>Same as <a href="../../futures_util/future/fn.try_join.html"><code>try_join</code></a>, but with more futures.</p>
</td></tr><tr class="module-item"><td><a class="fn" href="fn.try_maybe_done.html" title="futures_util::future::try_maybe_done fn">try_maybe_done</a></td><td class="docblock-short"><p>Wraps a future into a <code>TryMaybeDone</code></p>
</td></tr><tr class="module-item"><td><a class="fn" href="fn.try_select.html" title="futures_util::future::try_select fn">try_select</a></td><td class="docblock-short"><p>Waits for either one of two differently-typed futures to complete.</p>
</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "futures_util";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>