| <!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="An extension trait for `Future`s that provides a variety of convenient adapters."><meta name="keywords" content="rust, rustlang, rust-lang, FutureExt"><title>FutureExt in futures::future - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="../../normalize.css"><link rel="stylesheet" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../../ayu.css" disabled><link rel="stylesheet" href="../../dark.css" disabled><link rel="stylesheet" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../main.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.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]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../futures/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../futures/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">FutureExt</a></h2><div class="sidebar-elems"><section><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.boxed">boxed</a></li><li><a href="#method.boxed_local">boxed_local</a></li><li><a href="#method.catch_unwind">catch_unwind</a></li><li><a href="#method.flatten">flatten</a></li><li><a href="#method.flatten_stream">flatten_stream</a></li><li><a href="#method.fuse">fuse</a></li><li><a href="#method.inspect">inspect</a></li><li><a href="#method.into_stream">into_stream</a></li><li><a href="#method.left_future">left_future</a></li><li><a href="#method.map">map</a></li><li><a href="#method.map_into">map_into</a></li><li><a href="#method.never_error">never_error</a></li><li><a href="#method.now_or_never">now_or_never</a></li><li><a href="#method.poll_unpin">poll_unpin</a></li><li><a href="#method.remote_handle">remote_handle</a></li><li><a href="#method.right_future">right_future</a></li><li><a href="#method.shared">shared</a></li><li><a href="#method.then">then</a></li><li><a href="#method.unit_error">unit_error</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><h2><a href="index.html">In futures::future</a></h2></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn">Trait <a href="../index.html">futures</a>::<wbr><a href="index.html">future</a>::<wbr><a class="trait" href="#">FutureExt</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="srclink" href="../../src/futures_util/future/future/mod.rs.html#123">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="item-decl"><pre class="rust trait"><code>pub trait FutureExt: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a> { |
| <details class="rustdoc-toggle type-contents-toggle"><summary class="hideme"><span>Show 19 methods</span></summary> fn <a href="#method.map" class="fnname">map</a><U, F>(self, f: F) -> <a class="struct" href="struct.Map.html" title="struct futures::future::Map">Map</a><Self, F><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.Map.html" title="struct futures::future::Map">Map</a><Fut, F></span><code class="content"><span class="where fmt-newline">impl<Fut, F> <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a> for <a class="struct" href="struct.Map.html" title="struct futures::future::Map">Map</a><Fut, F><span class="where fmt-newline">where<br> Map<Fut, F>: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>,</span></span><span class="where fmt-newline"> type <a href="trait.Future.html#associatedtype.Output" class="associatedtype">Output</a> = <Map<Fut, F> as <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>;</span></code></span></span></span></span><br> <span class="where">where<br> F: FnOnce(Self::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>) -> U</span>, |
| { ... } |
| <span class="item-spacer"></span> fn <a href="#method.map_into" class="fnname">map_into</a><U>(self) -> <a class="struct" href="struct.MapInto.html" title="struct futures::future::MapInto">MapInto</a><Self, U><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.MapInto.html" title="struct futures::future::MapInto">MapInto</a><Fut, T></span><code class="content"><span class="where fmt-newline">impl<Fut, T> <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a> for <a class="struct" href="struct.MapInto.html" title="struct futures::future::MapInto">MapInto</a><Fut, T><span class="where fmt-newline">where<br> <a class="struct" href="struct.Map.html" title="struct futures::future::Map">Map</a><Fut, IntoFn<T>>: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>,</span></span><span class="where fmt-newline"> type <a href="trait.Future.html#associatedtype.Output" class="associatedtype">Output</a> = <<a class="struct" href="struct.Map.html" title="struct futures::future::Map">Map</a><Fut, IntoFn<T>> as <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>;</span></code></span></span></span></span><br> <span class="where">where<br> Self::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>: Into<U></span>, |
| { ... } |
| <span class="item-spacer"></span> fn <a href="#method.then" class="fnname">then</a><Fut, F>(self, f: F) -> <a class="struct" href="struct.Then.html" title="struct futures::future::Then">Then</a><Self, Fut, F><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.Then.html" title="struct futures::future::Then">Then</a><Fut1, Fut2, F></span><code class="content"><span class="where fmt-newline">impl<Fut1, Fut2, F> <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a> for <a class="struct" href="struct.Then.html" title="struct futures::future::Then">Then</a><Fut1, Fut2, F><span class="where fmt-newline">where<br> Flatten<<a class="struct" href="struct.Map.html" title="struct futures::future::Map">Map</a><Fut1, F>, Fut2>: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>,</span></span><span class="where fmt-newline"> type <a href="trait.Future.html#associatedtype.Output" class="associatedtype">Output</a> = <Flatten<<a class="struct" href="struct.Map.html" title="struct futures::future::Map">Map</a><Fut1, F>, Fut2> as <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>;</span></code></span></span></span></span><br> <span class="where">where<br> F: FnOnce(Self::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>) -> Fut,<br> Fut: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a></span>, |
| { ... } |
| <span class="item-spacer"></span> fn <a href="#method.left_future" class="fnname">left_future</a><B>(self) -> <a class="enum" href="enum.Either.html" title="enum futures::future::Either">Either</a><Self, B><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="enum" href="enum.Either.html" title="enum futures::future::Either">Either</a><A, B></span><code class="content"><span class="where fmt-newline">impl<A, B> <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a> for <a class="enum" href="enum.Either.html" title="enum futures::future::Either">Either</a><A, B><span class="where fmt-newline">where<br> A: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>,<br> B: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a><Output = <A as <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>>,</span></span><span class="where fmt-newline"> type <a href="trait.Future.html#associatedtype.Output" class="associatedtype">Output</a> = <A as <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>;</span></code></span></span></span></span><br> <span class="where">where<br> B: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a><Output = Self::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>></span>, |
| { ... } |
| <span class="item-spacer"></span> fn <a href="#method.right_future" class="fnname">right_future</a><A>(self) -> <a class="enum" href="enum.Either.html" title="enum futures::future::Either">Either</a><A, Self><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="enum" href="enum.Either.html" title="enum futures::future::Either">Either</a><A, B></span><code class="content"><span class="where fmt-newline">impl<A, B> <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a> for <a class="enum" href="enum.Either.html" title="enum futures::future::Either">Either</a><A, B><span class="where fmt-newline">where<br> A: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>,<br> B: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a><Output = <A as <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>>,</span></span><span class="where fmt-newline"> type <a href="trait.Future.html#associatedtype.Output" class="associatedtype">Output</a> = <A as <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>;</span></code></span></span></span></span><br> <span class="where">where<br> A: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a><Output = Self::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>></span>, |
| { ... } |
| <span class="item-spacer"></span> fn <a href="#method.into_stream" class="fnname">into_stream</a>(self) -> <a class="struct" href="struct.IntoStream.html" title="struct futures::future::IntoStream">IntoStream</a><Self> { ... } |
| <span class="item-spacer"></span> fn <a href="#method.flatten" class="fnname">flatten</a>(self) -> <a class="struct" href="struct.Flatten.html" title="struct futures::future::Flatten">Flatten</a><Self><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.Flatten.html" title="struct futures::future::Flatten">Flatten</a><F></span><code class="content"><span class="where fmt-newline">impl<F> <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a> for <a class="struct" href="struct.Flatten.html" title="struct futures::future::Flatten">Flatten</a><F><span class="where fmt-newline">where<br> Flatten<F, <F as <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>>: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>,<br> F: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>,</span></span><span class="where fmt-newline"> type <a href="trait.Future.html#associatedtype.Output" class="associatedtype">Output</a> = <Flatten<F, <F as <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>> as <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>;</span></code></span></span></span></span><br> <span class="where">where<br> Self::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a></span>, |
| { ... } |
| <span class="item-spacer"></span> fn <a href="#method.flatten_stream" class="fnname">flatten_stream</a>(self) -> <a class="struct" href="struct.FlattenStream.html" title="struct futures::future::FlattenStream">FlattenStream</a><Self><br> <span class="where">where<br> Self::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>: <a class="trait" href="../stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a></span>, |
| { ... } |
| <span class="item-spacer"></span> fn <a href="#method.fuse" class="fnname">fuse</a>(self) -> <a class="struct" href="struct.Fuse.html" title="struct futures::future::Fuse">Fuse</a><Self><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.Fuse.html" title="struct futures::future::Fuse">Fuse</a><Fut></span><code class="content"><span class="where fmt-newline">impl<Fut> <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a> for <a class="struct" href="struct.Fuse.html" title="struct futures::future::Fuse">Fuse</a><Fut><span class="where fmt-newline">where<br> Fut: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>,</span></span><span class="where fmt-newline"> type <a href="trait.Future.html#associatedtype.Output" class="associatedtype">Output</a> = <Fut as <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>;</span></code></span></span></span></span> { ... } |
| <span class="item-spacer"></span> fn <a href="#method.inspect" class="fnname">inspect</a><F>(self, f: F) -> <a class="struct" href="struct.Inspect.html" title="struct futures::future::Inspect">Inspect</a><Self, F><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.Inspect.html" title="struct futures::future::Inspect">Inspect</a><Fut, F></span><code class="content"><span class="where fmt-newline">impl<Fut, F> <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a> for <a class="struct" href="struct.Inspect.html" title="struct futures::future::Inspect">Inspect</a><Fut, F><span class="where fmt-newline">where<br> Map<Fut, InspectFn<F>>: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>,</span></span><span class="where fmt-newline"> type <a href="trait.Future.html#associatedtype.Output" class="associatedtype">Output</a> = <Map<Fut, InspectFn<F>> as <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>;</span></code></span></span></span></span><br> <span class="where">where<br> F: FnOnce(&Self::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>)</span>, |
| { ... } |
| <span class="item-spacer"></span> fn <a href="#method.catch_unwind" class="fnname">catch_unwind</a>(self) -> <a class="struct" href="struct.CatchUnwind.html" title="struct futures::future::CatchUnwind">CatchUnwind</a><Self><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.CatchUnwind.html" title="struct futures::future::CatchUnwind">CatchUnwind</a><Fut></span><code class="content"><span class="where fmt-newline">impl<Fut> <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a> for <a class="struct" href="struct.CatchUnwind.html" title="struct futures::future::CatchUnwind">CatchUnwind</a><Fut><span class="where fmt-newline">where<br> Fut: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a> + UnwindSafe,</span></span><span class="where fmt-newline"> type <a href="trait.Future.html#associatedtype.Output" class="associatedtype">Output</a> = Result<<Fut as <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>, Box<dyn Any + Send + 'static, Global>>;</span></code></span></span></span></span><br> <span class="where">where<br> Self: UnwindSafe</span>, |
| { ... } |
| <span class="item-spacer"></span> fn <a href="#method.shared" class="fnname">shared</a>(self) -> <a class="struct" href="struct.Shared.html" title="struct futures::future::Shared">Shared</a><Self><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.Shared.html" title="struct futures::future::Shared">Shared</a><Fut></span><code class="content"><span class="where fmt-newline">impl<Fut> <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a> for <a class="struct" href="struct.Shared.html" title="struct futures::future::Shared">Shared</a><Fut><span class="where fmt-newline">where<br> Fut: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>,<br> <Fut as <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>: Clone,</span></span><span class="where fmt-newline"> type <a href="trait.Future.html#associatedtype.Output" class="associatedtype">Output</a> = <Fut as <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>;</span></code></span></span></span></span><br> <span class="where">where<br> Self::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>: Clone</span>, |
| { ... } |
| <span class="item-spacer"></span> fn <a href="#method.remote_handle" class="fnname">remote_handle</a>(self) -> (<a class="struct" href="struct.Remote.html" title="struct futures::future::Remote">Remote</a><Self>, <a class="struct" href="struct.RemoteHandle.html" title="struct futures::future::RemoteHandle">RemoteHandle</a><Self::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>>) { ... } |
| <span class="item-spacer"></span> fn <a href="#method.boxed" class="fnname">boxed</a><'a>(<br> self<br> ) -> Pin<Box<dyn <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a><Output = Self::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>> + Send + 'a, Global>><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for Pin<P></span><code class="content"><span class="where fmt-newline">impl<P> <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a> for Pin<P><span class="where fmt-newline">where<br> P: DerefMut,<br> <P as Deref>::Target: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>,</span></span><span class="where fmt-newline"> type <a href="trait.Future.html#associatedtype.Output" class="associatedtype">Output</a> = <<P as Deref>::Target as <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>;</span></code></span></span></span></span><br> <span class="where">where<br> Self: 'a + Send</span>, |
| { ... } |
| <span class="item-spacer"></span> fn <a href="#method.boxed_local" class="fnname">boxed_local</a><'a>(<br> self<br> ) -> Pin<Box<dyn <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a><Output = Self::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>> + 'a, Global>><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for Pin<P></span><code class="content"><span class="where fmt-newline">impl<P> <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a> for Pin<P><span class="where fmt-newline">where<br> P: DerefMut,<br> <P as Deref>::Target: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>,</span></span><span class="where fmt-newline"> type <a href="trait.Future.html#associatedtype.Output" class="associatedtype">Output</a> = <<P as Deref>::Target as <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>;</span></code></span></span></span></span><br> <span class="where">where<br> Self: 'a</span>, |
| { ... } |
| <span class="item-spacer"></span> fn <a href="#method.unit_error" class="fnname">unit_error</a>(self) -> <a class="struct" href="struct.UnitError.html" title="struct futures::future::UnitError">UnitError</a><Self><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.UnitError.html" title="struct futures::future::UnitError">UnitError</a><Fut></span><code class="content"><span class="where fmt-newline">impl<Fut> <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a> for <a class="struct" href="struct.UnitError.html" title="struct futures::future::UnitError">UnitError</a><Fut><span class="where fmt-newline">where<br> <a class="struct" href="struct.Map.html" title="struct futures::future::Map">Map</a><Fut, OkFn<()>>: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>,</span></span><span class="where fmt-newline"> type <a href="trait.Future.html#associatedtype.Output" class="associatedtype">Output</a> = <<a class="struct" href="struct.Map.html" title="struct futures::future::Map">Map</a><Fut, OkFn<()>> as <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>;</span></code></span></span></span></span> { ... } |
| <span class="item-spacer"></span> fn <a href="#method.never_error" class="fnname">never_error</a>(self) -> <a class="struct" href="struct.NeverError.html" title="struct futures::future::NeverError">NeverError</a><Self><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.NeverError.html" title="struct futures::future::NeverError">NeverError</a><Fut></span><code class="content"><span class="where fmt-newline">impl<Fut> <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a> for <a class="struct" href="struct.NeverError.html" title="struct futures::future::NeverError">NeverError</a><Fut><span class="where fmt-newline">where<br> <a class="struct" href="struct.Map.html" title="struct futures::future::Map">Map</a><Fut, OkFn<Infallible>>: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>,</span></span><span class="where fmt-newline"> type <a href="trait.Future.html#associatedtype.Output" class="associatedtype">Output</a> = <<a class="struct" href="struct.Map.html" title="struct futures::future::Map">Map</a><Fut, OkFn<Infallible>> as <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>;</span></code></span></span></span></span> { ... } |
| <span class="item-spacer"></span> fn <a href="#method.poll_unpin" class="fnname">poll_unpin</a>(&mut self, cx: &mut <a class="struct" href="../task/struct.Context.html" title="struct futures::task::Context">Context</a><'_>) -> <a class="enum" href="../task/enum.Poll.html" title="enum futures::task::Poll">Poll</a><Self::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>><br> <span class="where">where<br> Self: Unpin</span>, |
| { ... } |
| <span class="item-spacer"></span> fn <a href="#method.now_or_never" class="fnname">now_or_never</a>(self) -> Option<Self::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>> { ... } |
| </details>}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>An extension trait for <code>Future</code>s that provides a variety of convenient |
| adapters.</p> |
| </div></details><h2 id="provided-methods" class="small-section-header">Provided Methods<a href="#provided-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.map" class="method has-srclink"><a class="srclink rightside" href="../../src/futures_util/future/future/mod.rs.html#146-149">source</a><h4 class="code-header">fn <a href="#method.map" class="fnname">map</a><U, F>(self, f: F) -> <a class="struct" href="struct.Map.html" title="struct futures::future::Map">Map</a><Self, F><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.Map.html" title="struct futures::future::Map">Map</a><Fut, F></span><code class="content"><span class="where fmt-newline">impl<Fut, F> <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a> for <a class="struct" href="struct.Map.html" title="struct futures::future::Map">Map</a><Fut, F><span class="where fmt-newline">where<br> Map<Fut, F>: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>,</span></span><span class="where fmt-newline"> type <a href="trait.Future.html#associatedtype.Output" class="associatedtype">Output</a> = <Map<Fut, F> as <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>;</span></code></span></span></span></span><span class="where fmt-newline">where<br> F: FnOnce(Self::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>) -> U,</span></h4></section></summary><div class="docblock"><p>Map this future’s output to a different type, returning a new future of |
| the resulting type.</p> |
| <p>This function is similar to the <code>Option::map</code> or <code>Iterator::map</code> where |
| it will change the type of the underlying future. This is useful to |
| chain along a computation once a future has been resolved.</p> |
| <p>Note that this function consumes the receiving future and returns a |
| wrapped version of it, similar to the existing <code>map</code> methods in the |
| standard library.</p> |
| <h5 id="examples"><a href="#examples">Examples</a></h5> |
| <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>futures::future::FutureExt; |
| |
| <span class="kw">let </span>future = <span class="kw">async </span>{ <span class="number">1 </span>}; |
| <span class="kw">let </span>new_future = future.map(|x| x + <span class="number">3</span>); |
| <span class="macro">assert_eq!</span>(new_future.<span class="kw">await</span>, <span class="number">4</span>);</code></pre></div> |
| </div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.map_into" class="method has-srclink"><a class="srclink rightside" href="../../src/futures_util/future/future/mod.rs.html#159-162">source</a><h4 class="code-header">fn <a href="#method.map_into" class="fnname">map_into</a><U>(self) -> <a class="struct" href="struct.MapInto.html" title="struct futures::future::MapInto">MapInto</a><Self, U><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.MapInto.html" title="struct futures::future::MapInto">MapInto</a><Fut, T></span><code class="content"><span class="where fmt-newline">impl<Fut, T> <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a> for <a class="struct" href="struct.MapInto.html" title="struct futures::future::MapInto">MapInto</a><Fut, T><span class="where fmt-newline">where<br> <a class="struct" href="struct.Map.html" title="struct futures::future::Map">Map</a><Fut, IntoFn<T>>: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>,</span></span><span class="where fmt-newline"> type <a href="trait.Future.html#associatedtype.Output" class="associatedtype">Output</a> = <<a class="struct" href="struct.Map.html" title="struct futures::future::Map">Map</a><Fut, IntoFn<T>> as <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>;</span></code></span></span></span></span><span class="where fmt-newline">where<br> Self::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>: Into<U>,</span></h4></section></summary><div class="docblock"><p>Map this future’s output to a different type, returning a new future of |
| the resulting type.</p> |
| <p>This function is equivalent to calling <code>map(Into::into)</code> but allows naming |
| the return type.</p> |
| </div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.then" class="method has-srclink"><a class="srclink rightside" href="../../src/futures_util/future/future/mod.rs.html#191-195">source</a><h4 class="code-header">fn <a href="#method.then" class="fnname">then</a><Fut, F>(self, f: F) -> <a class="struct" href="struct.Then.html" title="struct futures::future::Then">Then</a><Self, Fut, F><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.Then.html" title="struct futures::future::Then">Then</a><Fut1, Fut2, F></span><code class="content"><span class="where fmt-newline">impl<Fut1, Fut2, F> <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a> for <a class="struct" href="struct.Then.html" title="struct futures::future::Then">Then</a><Fut1, Fut2, F><span class="where fmt-newline">where<br> Flatten<<a class="struct" href="struct.Map.html" title="struct futures::future::Map">Map</a><Fut1, F>, Fut2>: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>,</span></span><span class="where fmt-newline"> type <a href="trait.Future.html#associatedtype.Output" class="associatedtype">Output</a> = <Flatten<<a class="struct" href="struct.Map.html" title="struct futures::future::Map">Map</a><Fut1, F>, Fut2> as <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>;</span></code></span></span></span></span><span class="where fmt-newline">where<br> F: FnOnce(Self::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>) -> Fut,<br> Fut: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>,</span></h4></section></summary><div class="docblock"><p>Chain on a computation for when a future finished, passing the result of |
| the future to the provided closure <code>f</code>.</p> |
| <p>The returned value of the closure must implement the <code>Future</code> trait |
| and can represent some more work to be done before the composed future |
| is finished.</p> |
| <p>The closure <code>f</code> is only run <em>after</em> successful completion of the <code>self</code> |
| future.</p> |
| <p>Note that this function consumes the receiving future and returns a |
| wrapped version of it.</p> |
| <h5 id="examples-1"><a href="#examples-1">Examples</a></h5> |
| <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>futures::future::FutureExt; |
| |
| <span class="kw">let </span>future_of_1 = <span class="kw">async </span>{ <span class="number">1 </span>}; |
| <span class="kw">let </span>future_of_4 = future_of_1.then(|x| <span class="kw">async move </span>{ x + <span class="number">3 </span>}); |
| <span class="macro">assert_eq!</span>(future_of_4.<span class="kw">await</span>, <span class="number">4</span>);</code></pre></div> |
| </div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.left_future" class="method has-srclink"><a class="srclink rightside" href="../../src/futures_util/future/future/mod.rs.html#222-225">source</a><h4 class="code-header">fn <a href="#method.left_future" class="fnname">left_future</a><B>(self) -> <a class="enum" href="enum.Either.html" title="enum futures::future::Either">Either</a><Self, B><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="enum" href="enum.Either.html" title="enum futures::future::Either">Either</a><A, B></span><code class="content"><span class="where fmt-newline">impl<A, B> <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a> for <a class="enum" href="enum.Either.html" title="enum futures::future::Either">Either</a><A, B><span class="where fmt-newline">where<br> A: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>,<br> B: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a><Output = <A as <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>>,</span></span><span class="where fmt-newline"> type <a href="trait.Future.html#associatedtype.Output" class="associatedtype">Output</a> = <A as <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>;</span></code></span></span></span></span><span class="where fmt-newline">where<br> B: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a><Output = Self::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>>,</span></h4></section></summary><div class="docblock"><p>Wrap this future in an <code>Either</code> future, making it the left-hand variant |
| of that <code>Either</code>.</p> |
| <p>This can be used in combination with the <code>right_future</code> method to write <code>if</code> |
| statements that evaluate to different futures in different branches.</p> |
| <h5 id="examples-2"><a href="#examples-2">Examples</a></h5> |
| <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>futures::future::FutureExt; |
| |
| <span class="kw">let </span>x = <span class="number">6</span>; |
| <span class="kw">let </span>future = <span class="kw">if </span>x < <span class="number">10 </span>{ |
| <span class="kw">async </span>{ <span class="bool-val">true </span>}.left_future() |
| } <span class="kw">else </span>{ |
| <span class="kw">async </span>{ <span class="bool-val">false </span>}.right_future() |
| }; |
| |
| <span class="macro">assert_eq!</span>(future.<span class="kw">await</span>, <span class="bool-val">true</span>);</code></pre></div> |
| </div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.right_future" class="method has-srclink"><a class="srclink rightside" href="../../src/futures_util/future/future/mod.rs.html#252-255">source</a><h4 class="code-header">fn <a href="#method.right_future" class="fnname">right_future</a><A>(self) -> <a class="enum" href="enum.Either.html" title="enum futures::future::Either">Either</a><A, Self><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="enum" href="enum.Either.html" title="enum futures::future::Either">Either</a><A, B></span><code class="content"><span class="where fmt-newline">impl<A, B> <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a> for <a class="enum" href="enum.Either.html" title="enum futures::future::Either">Either</a><A, B><span class="where fmt-newline">where<br> A: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>,<br> B: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a><Output = <A as <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>>,</span></span><span class="where fmt-newline"> type <a href="trait.Future.html#associatedtype.Output" class="associatedtype">Output</a> = <A as <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>;</span></code></span></span></span></span><span class="where fmt-newline">where<br> A: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a><Output = Self::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>>,</span></h4></section></summary><div class="docblock"><p>Wrap this future in an <code>Either</code> future, making it the right-hand variant |
| of that <code>Either</code>.</p> |
| <p>This can be used in combination with the <code>left_future</code> method to write <code>if</code> |
| statements that evaluate to different futures in different branches.</p> |
| <h5 id="examples-3"><a href="#examples-3">Examples</a></h5> |
| <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>futures::future::FutureExt; |
| |
| <span class="kw">let </span>x = <span class="number">6</span>; |
| <span class="kw">let </span>future = <span class="kw">if </span>x > <span class="number">10 </span>{ |
| <span class="kw">async </span>{ <span class="bool-val">true </span>}.left_future() |
| } <span class="kw">else </span>{ |
| <span class="kw">async </span>{ <span class="bool-val">false </span>}.right_future() |
| }; |
| |
| <span class="macro">assert_eq!</span>(future.<span class="kw">await</span>, <span class="bool-val">false</span>);</code></pre></div> |
| </div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into_stream" class="method has-srclink"><a class="srclink rightside" href="../../src/futures_util/future/future/mod.rs.html#278-280">source</a><h4 class="code-header">fn <a href="#method.into_stream" class="fnname">into_stream</a>(self) -> <a class="struct" href="struct.IntoStream.html" title="struct futures::future::IntoStream">IntoStream</a><Self></h4></section></summary><div class="docblock"><p>Convert this future into a single element stream.</p> |
| <p>The returned stream contains single success if this future resolves to |
| success or single error if this future resolves into error.</p> |
| <h5 id="examples-4"><a href="#examples-4">Examples</a></h5> |
| <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>futures::future::FutureExt; |
| <span class="kw">use </span>futures::stream::StreamExt; |
| |
| <span class="kw">let </span>future = <span class="kw">async </span>{ <span class="number">17 </span>}; |
| <span class="kw">let </span>stream = future.into_stream(); |
| <span class="kw">let </span>collected: Vec<<span class="kw">_</span>> = stream.collect().<span class="kw">await</span>; |
| <span class="macro">assert_eq!</span>(collected, <span class="macro">vec!</span>[<span class="number">17</span>]);</code></pre></div> |
| </div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.flatten" class="method has-srclink"><a class="srclink rightside" href="../../src/futures_util/future/future/mod.rs.html#307-310">source</a><h4 class="code-header">fn <a href="#method.flatten" class="fnname">flatten</a>(self) -> <a class="struct" href="struct.Flatten.html" title="struct futures::future::Flatten">Flatten</a><Self><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.Flatten.html" title="struct futures::future::Flatten">Flatten</a><F></span><code class="content"><span class="where fmt-newline">impl<F> <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a> for <a class="struct" href="struct.Flatten.html" title="struct futures::future::Flatten">Flatten</a><F><span class="where fmt-newline">where<br> Flatten<F, <F as <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>>: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>,<br> F: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>,</span></span><span class="where fmt-newline"> type <a href="trait.Future.html#associatedtype.Output" class="associatedtype">Output</a> = <Flatten<F, <F as <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>> as <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>;</span></code></span></span></span></span><span class="where fmt-newline">where<br> Self::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>,</span></h4></section></summary><div class="docblock"><p>Flatten the execution of this future when the output of this |
| future is itself another future.</p> |
| <p>This can be useful when combining futures together to flatten the |
| computation out the final result.</p> |
| <p>This method is roughly equivalent to <code>self.then(|x| x)</code>.</p> |
| <p>Note that this function consumes the receiving future and returns a |
| wrapped version of it.</p> |
| <h5 id="examples-5"><a href="#examples-5">Examples</a></h5> |
| <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>futures::future::FutureExt; |
| |
| <span class="kw">let </span>nested_future = <span class="kw">async </span>{ <span class="kw">async </span>{ <span class="number">1 </span>} }; |
| <span class="kw">let </span>future = nested_future.flatten(); |
| <span class="macro">assert_eq!</span>(future.<span class="kw">await</span>, <span class="number">1</span>);</code></pre></div> |
| </div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.flatten_stream" class="method has-srclink"><a class="srclink rightside" href="../../src/futures_util/future/future/mod.rs.html#341-344">source</a><h4 class="code-header">fn <a href="#method.flatten_stream" class="fnname">flatten_stream</a>(self) -> <a class="struct" href="struct.FlattenStream.html" title="struct futures::future::FlattenStream">FlattenStream</a><Self><span class="where fmt-newline">where<br> Self::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>: <a class="trait" href="../stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>,</span></h4></section></summary><div class="docblock"><p>Flatten the execution of this future when the successful result of this |
| future is a stream.</p> |
| <p>This can be useful when stream initialization is deferred, and it is |
| convenient to work with that stream as if stream was available at the |
| call site.</p> |
| <p>Note that this function consumes this future and returns a wrapped |
| version of it.</p> |
| <h5 id="examples-6"><a href="#examples-6">Examples</a></h5> |
| <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>futures::future::FutureExt; |
| <span class="kw">use </span>futures::stream::{<span class="self">self</span>, StreamExt}; |
| |
| <span class="kw">let </span>stream_items = <span class="macro">vec!</span>[<span class="number">17</span>, <span class="number">18</span>, <span class="number">19</span>]; |
| <span class="kw">let </span>future_of_a_stream = <span class="kw">async </span>{ stream::iter(stream_items) }; |
| |
| <span class="kw">let </span>stream = future_of_a_stream.flatten_stream(); |
| <span class="kw">let </span>list: Vec<<span class="kw">_</span>> = stream.collect().<span class="kw">await</span>; |
| <span class="macro">assert_eq!</span>(list, <span class="macro">vec!</span>[<span class="number">17</span>, <span class="number">18</span>, <span class="number">19</span>]);</code></pre></div> |
| </div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fuse" class="method has-srclink"><a class="srclink rightside" href="../../src/futures_util/future/future/mod.rs.html#365-367">source</a><h4 class="code-header">fn <a href="#method.fuse" class="fnname">fuse</a>(self) -> <a class="struct" href="struct.Fuse.html" title="struct futures::future::Fuse">Fuse</a><Self><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.Fuse.html" title="struct futures::future::Fuse">Fuse</a><Fut></span><code class="content"><span class="where fmt-newline">impl<Fut> <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a> for <a class="struct" href="struct.Fuse.html" title="struct futures::future::Fuse">Fuse</a><Fut><span class="where fmt-newline">where<br> Fut: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>,</span></span><span class="where fmt-newline"> type <a href="trait.Future.html#associatedtype.Output" class="associatedtype">Output</a> = <Fut as <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>;</span></code></span></span></span></span></h4></section></summary><div class="docblock"><p>Fuse a future such that <code>poll</code> will never again be called once it has |
| completed. This method can be used to turn any <code>Future</code> into a |
| <code>FusedFuture</code>.</p> |
| <p>Normally, once a future has returned <code>Poll::Ready</code> from <code>poll</code>, |
| any further calls could exhibit bad behavior such as blocking |
| forever, panicking, never returning, etc. If it is known that <code>poll</code> |
| may be called too often then this method can be used to ensure that it |
| has defined semantics.</p> |
| <p>If a <code>fuse</code>d future is <code>poll</code>ed after having returned <code>Poll::Ready</code> |
| previously, it will return <code>Poll::Pending</code>, from <code>poll</code> again (and will |
| continue to do so for all future calls to <code>poll</code>).</p> |
| <p>This combinator will drop the underlying future as soon as it has been |
| completed to ensure resources are reclaimed as soon as possible.</p> |
| </div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.inspect" class="method has-srclink"><a class="srclink rightside" href="../../src/futures_util/future/future/mod.rs.html#391-394">source</a><h4 class="code-header">fn <a href="#method.inspect" class="fnname">inspect</a><F>(self, f: F) -> <a class="struct" href="struct.Inspect.html" title="struct futures::future::Inspect">Inspect</a><Self, F><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.Inspect.html" title="struct futures::future::Inspect">Inspect</a><Fut, F></span><code class="content"><span class="where fmt-newline">impl<Fut, F> <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a> for <a class="struct" href="struct.Inspect.html" title="struct futures::future::Inspect">Inspect</a><Fut, F><span class="where fmt-newline">where<br> Map<Fut, InspectFn<F>>: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>,</span></span><span class="where fmt-newline"> type <a href="trait.Future.html#associatedtype.Output" class="associatedtype">Output</a> = <Map<Fut, InspectFn<F>> as <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>;</span></code></span></span></span></span><span class="where fmt-newline">where<br> F: FnOnce(&Self::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>),</span></h4></section></summary><div class="docblock"><p>Do something with the output of a future before passing it on.</p> |
| <p>When using futures, you’ll often chain several of them together. While |
| working on such code, you might want to check out what’s happening at |
| various parts in the pipeline, without consuming the intermediate |
| value. To do that, insert a call to <code>inspect</code>.</p> |
| <h5 id="examples-7"><a href="#examples-7">Examples</a></h5> |
| <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>futures::future::FutureExt; |
| |
| <span class="kw">let </span>future = <span class="kw">async </span>{ <span class="number">1 </span>}; |
| <span class="kw">let </span>new_future = future.inspect(|<span class="kw-2">&</span>x| <span class="macro">println!</span>(<span class="string">"about to resolve: {}"</span>, x)); |
| <span class="macro">assert_eq!</span>(new_future.<span class="kw">await</span>, <span class="number">1</span>);</code></pre></div> |
| </div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.catch_unwind" class="method has-srclink"><a class="srclink rightside" href="../../src/futures_util/future/future/mod.rs.html#431-433">source</a><h4 class="code-header">fn <a href="#method.catch_unwind" class="fnname">catch_unwind</a>(self) -> <a class="struct" href="struct.CatchUnwind.html" title="struct futures::future::CatchUnwind">CatchUnwind</a><Self><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.CatchUnwind.html" title="struct futures::future::CatchUnwind">CatchUnwind</a><Fut></span><code class="content"><span class="where fmt-newline">impl<Fut> <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a> for <a class="struct" href="struct.CatchUnwind.html" title="struct futures::future::CatchUnwind">CatchUnwind</a><Fut><span class="where fmt-newline">where<br> Fut: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a> + UnwindSafe,</span></span><span class="where fmt-newline"> type <a href="trait.Future.html#associatedtype.Output" class="associatedtype">Output</a> = Result<<Fut as <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>, Box<dyn Any + Send + 'static, Global>>;</span></code></span></span></span></span><span class="where fmt-newline">where<br> Self: UnwindSafe,</span></h4></section></summary><div class="docblock"><p>Catches unwinding panics while polling the future.</p> |
| <p>In general, panics within a future can propagate all the way out to the |
| task level. This combinator makes it possible to halt unwinding within |
| the future itself. It’s most commonly used within task executors. It’s |
| not recommended to use this for error handling.</p> |
| <p>Note that this method requires the <code>UnwindSafe</code> bound from the standard |
| library. This isn’t always applied automatically, and the standard |
| library provides an <code>AssertUnwindSafe</code> wrapper type to apply it |
| after-the fact. To assist using this method, the <code>Future</code> trait is also |
| implemented for <code>AssertUnwindSafe<F></code> where <code>F</code> implements <code>Future</code>.</p> |
| <p>This method is only available when the <code>std</code> feature of this |
| library is activated, and it is activated by default.</p> |
| <h5 id="examples-8"><a href="#examples-8">Examples</a></h5> |
| <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>futures::future::{<span class="self">self</span>, FutureExt, Ready}; |
| |
| <span class="kw">let </span>future = future::ready(<span class="number">2</span>); |
| <span class="macro">assert!</span>(future.catch_unwind().<span class="kw">await</span>.is_ok()); |
| |
| <span class="kw">let </span>future = future::lazy(|<span class="kw">_</span>| -> Ready<i32> { |
| <span class="macro">unimplemented!</span>() |
| }); |
| <span class="macro">assert!</span>(future.catch_unwind().<span class="kw">await</span>.is_err());</code></pre></div> |
| </div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.shared" class="method has-srclink"><a class="srclink rightside" href="../../src/futures_util/future/future/mod.rs.html#486-489">source</a><h4 class="code-header">fn <a href="#method.shared" class="fnname">shared</a>(self) -> <a class="struct" href="struct.Shared.html" title="struct futures::future::Shared">Shared</a><Self><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.Shared.html" title="struct futures::future::Shared">Shared</a><Fut></span><code class="content"><span class="where fmt-newline">impl<Fut> <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a> for <a class="struct" href="struct.Shared.html" title="struct futures::future::Shared">Shared</a><Fut><span class="where fmt-newline">where<br> Fut: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>,<br> <Fut as <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>: Clone,</span></span><span class="where fmt-newline"> type <a href="trait.Future.html#associatedtype.Output" class="associatedtype">Output</a> = <Fut as <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>;</span></code></span></span></span></span><span class="where fmt-newline">where<br> Self::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>: Clone,</span></h4></section></summary><div class="docblock"><p>Create a cloneable handle to this future where all handles will resolve |
| to the same result.</p> |
| <p>The <code>shared</code> combinator method provides a method to convert any future |
| into a cloneable future. It enables a future to be polled by multiple |
| threads.</p> |
| <p>This method is only available when the <code>std</code> feature of this |
| library is activated, and it is activated by default.</p> |
| <h5 id="examples-9"><a href="#examples-9">Examples</a></h5> |
| <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>futures::future::FutureExt; |
| |
| <span class="kw">let </span>future = <span class="kw">async </span>{ <span class="number">6 </span>}; |
| <span class="kw">let </span>shared1 = future.shared(); |
| <span class="kw">let </span>shared2 = shared1.clone(); |
| |
| <span class="macro">assert_eq!</span>(<span class="number">6</span>, shared1.<span class="kw">await</span>); |
| <span class="macro">assert_eq!</span>(<span class="number">6</span>, shared2.<span class="kw">await</span>);</code></pre></div> |
| |
| <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="comment">// Note, unlike most examples this is written in the context of a |
| // synchronous function to better illustrate the cross-thread aspect of |
| // the `shared` combinator. |
| |
| </span><span class="kw">use </span>futures::future::FutureExt; |
| <span class="kw">use </span>futures::executor::block_on; |
| <span class="kw">use </span>std::thread; |
| |
| <span class="kw">let </span>future = <span class="kw">async </span>{ <span class="number">6 </span>}; |
| <span class="kw">let </span>shared1 = future.shared(); |
| <span class="kw">let </span>shared2 = shared1.clone(); |
| <span class="kw">let </span>join_handle = thread::spawn(<span class="kw">move </span>|| { |
| <span class="macro">assert_eq!</span>(<span class="number">6</span>, block_on(shared2)); |
| }); |
| <span class="macro">assert_eq!</span>(<span class="number">6</span>, shared1.<span class="kw">await</span>); |
| join_handle.join().unwrap();</code></pre></div> |
| </div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.remote_handle" class="method has-srclink"><a class="srclink rightside" href="../../src/futures_util/future/future/mod.rs.html#505-507">source</a><h4 class="code-header">fn <a href="#method.remote_handle" class="fnname">remote_handle</a>(self) -> (<a class="struct" href="struct.Remote.html" title="struct futures::future::Remote">Remote</a><Self>, <a class="struct" href="struct.RemoteHandle.html" title="struct futures::future::RemoteHandle">RemoteHandle</a><Self::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>>)</h4></section></summary><div class="docblock"><p>Turn this future into a future that yields <code>()</code> on completion and sends |
| its output to another future on a separate task.</p> |
| <p>This can be used with spawning executors to easily retrieve the result |
| of a future executing on a separate task or thread.</p> |
| <p>This method is only available when the <code>std</code> feature of this |
| library is activated, and it is activated by default.</p> |
| </div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.boxed" class="method has-srclink"><a class="srclink rightside" href="../../src/futures_util/future/future/mod.rs.html#518-520">source</a><h4 class="code-header">fn <a href="#method.boxed" class="fnname">boxed</a><'a>(<br> self<br>) -> Pin<Box<dyn <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a><Output = Self::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>> + Send + 'a, Global>><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for Pin<P></span><code class="content"><span class="where fmt-newline">impl<P> <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a> for Pin<P><span class="where fmt-newline">where<br> P: DerefMut,<br> <P as Deref>::Target: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>,</span></span><span class="where fmt-newline"> type <a href="trait.Future.html#associatedtype.Output" class="associatedtype">Output</a> = <<P as Deref>::Target as <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>;</span></code></span></span></span></span><span class="where fmt-newline">where<br> Self: 'a + Send,</span></h4></section></summary><div class="docblock"><p>Wrap the future in a Box, pinning it.</p> |
| <p>This method is only available when the <code>std</code> or <code>alloc</code> feature of this |
| library is activated, and it is activated by default.</p> |
| </div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.boxed_local" class="method has-srclink"><a class="srclink rightside" href="../../src/futures_util/future/future/mod.rs.html#532-534">source</a><h4 class="code-header">fn <a href="#method.boxed_local" class="fnname">boxed_local</a><'a>(<br> self<br>) -> Pin<Box<dyn <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a><Output = Self::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>> + 'a, Global>><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for Pin<P></span><code class="content"><span class="where fmt-newline">impl<P> <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a> for Pin<P><span class="where fmt-newline">where<br> P: DerefMut,<br> <P as Deref>::Target: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>,</span></span><span class="where fmt-newline"> type <a href="trait.Future.html#associatedtype.Output" class="associatedtype">Output</a> = <<P as Deref>::Target as <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>;</span></code></span></span></span></span><span class="where fmt-newline">where<br> Self: 'a,</span></h4></section></summary><div class="docblock"><p>Wrap the future in a Box, pinning it.</p> |
| <p>Similar to <code>boxed</code>, but without the <code>Send</code> requirement.</p> |
| <p>This method is only available when the <code>std</code> or <code>alloc</code> feature of this |
| library is activated, and it is activated by default.</p> |
| </div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.unit_error" class="method has-srclink"><a class="srclink rightside" href="../../src/futures_util/future/future/mod.rs.html#541-543">source</a><h4 class="code-header">fn <a href="#method.unit_error" class="fnname">unit_error</a>(self) -> <a class="struct" href="struct.UnitError.html" title="struct futures::future::UnitError">UnitError</a><Self><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.UnitError.html" title="struct futures::future::UnitError">UnitError</a><Fut></span><code class="content"><span class="where fmt-newline">impl<Fut> <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a> for <a class="struct" href="struct.UnitError.html" title="struct futures::future::UnitError">UnitError</a><Fut><span class="where fmt-newline">where<br> <a class="struct" href="struct.Map.html" title="struct futures::future::Map">Map</a><Fut, OkFn<()>>: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>,</span></span><span class="where fmt-newline"> type <a href="trait.Future.html#associatedtype.Output" class="associatedtype">Output</a> = <<a class="struct" href="struct.Map.html" title="struct futures::future::Map">Map</a><Fut, OkFn<()>> as <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>;</span></code></span></span></span></span></h4></section></summary><div class="docblock"><p>Turns a <a href="trait.Future.html"><code>Future<Output = T></code></a> into a |
| <a href="trait.TryFuture.html"><code>TryFuture<Ok = T, Error = ()</code>></a>.</p> |
| </div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.never_error" class="method has-srclink"><a class="srclink rightside" href="../../src/futures_util/future/future/mod.rs.html#550-552">source</a><h4 class="code-header">fn <a href="#method.never_error" class="fnname">never_error</a>(self) -> <a class="struct" href="struct.NeverError.html" title="struct futures::future::NeverError">NeverError</a><Self><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.NeverError.html" title="struct futures::future::NeverError">NeverError</a><Fut></span><code class="content"><span class="where fmt-newline">impl<Fut> <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a> for <a class="struct" href="struct.NeverError.html" title="struct futures::future::NeverError">NeverError</a><Fut><span class="where fmt-newline">where<br> <a class="struct" href="struct.Map.html" title="struct futures::future::Map">Map</a><Fut, OkFn<Infallible>>: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>,</span></span><span class="where fmt-newline"> type <a href="trait.Future.html#associatedtype.Output" class="associatedtype">Output</a> = <<a class="struct" href="struct.Map.html" title="struct futures::future::Map">Map</a><Fut, OkFn<Infallible>> as <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>;</span></code></span></span></span></span></h4></section></summary><div class="docblock"><p>Turns a <a href="trait.Future.html"><code>Future<Output = T></code></a> into a |
| <a href="trait.TryFuture.html"><code>TryFuture<Ok = T, Error = Never</code>></a>.</p> |
| </div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.poll_unpin" class="method has-srclink"><a class="srclink rightside" href="../../src/futures_util/future/future/mod.rs.html#558-560">source</a><h4 class="code-header">fn <a href="#method.poll_unpin" class="fnname">poll_unpin</a>(&mut self, cx: &mut <a class="struct" href="../task/struct.Context.html" title="struct futures::task::Context">Context</a><'_>) -> <a class="enum" href="../task/enum.Poll.html" title="enum futures::task::Poll">Poll</a><Self::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>><span class="where fmt-newline">where<br> Self: Unpin,</span></h4></section></summary><div class="docblock"><p>A convenience for calling <code>Future::poll</code> on <code>Unpin</code> future types.</p> |
| </div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.now_or_never" class="method has-srclink"><a class="srclink rightside" href="../../src/futures_util/future/future/mod.rs.html#596-598">source</a><h4 class="code-header">fn <a href="#method.now_or_never" class="fnname">now_or_never</a>(self) -> Option<Self::<a class="associatedtype" href="trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>></h4></section></summary><div class="docblock"><p>Evaluates and consumes the future, returning the resulting output if |
| the future is ready after the first call to <code>Future::poll</code>.</p> |
| <p>If <code>poll</code> instead returns <code>Poll::Pending</code>, <code>None</code> is returned.</p> |
| <p>This method is useful in cases where immediacy is more important than |
| waiting for a result. It is also convenient for quickly obtaining |
| the value of a future that is known to always resolve immediately.</p> |
| <h5 id="examples-10"><a href="#examples-10">Examples</a></h5> |
| <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>futures::{future::ready, future::pending}; |
| <span class="kw">let </span>future_ready = ready(<span class="string">"foobar"</span>); |
| <span class="kw">let </span>future_pending = pending::<<span class="kw-2">&</span><span class="lifetime">'static </span>str>(); |
| |
| <span class="macro">assert_eq!</span>(future_ready.now_or_never(), <span class="prelude-val">Some</span>(<span class="string">"foobar"</span>)); |
| <span class="macro">assert_eq!</span>(future_pending.now_or_never(), <span class="prelude-val">None</span>);</code></pre></div> |
| <p>In cases where it is absolutely known that a future should always |
| resolve immediately and never return <code>Poll::Pending</code>, this method can |
| be combined with <code>expect()</code>:</p> |
| |
| <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>future_ready = ready(<span class="string">"foobar"</span>); |
| |
| <span class="macro">assert_eq!</span>(future_ready.now_or_never().expect(<span class="string">"Future not ready"</span>), <span class="string">"foobar"</span>);</code></pre></div> |
| </div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div id="implementors-list"><section id="impl-FutureExt-for-T" class="impl has-srclink"><a class="srclink rightside" href="../../src/futures_util/future/future/mod.rs.html#119">source</a><a href="#impl-FutureExt-for-T" class="anchor"></a><h3 class="code-header">impl<T> <a class="trait" href="trait.FutureExt.html" title="trait futures::future::FutureExt">FutureExt</a> for T<span class="where fmt-newline">where<br> T: <a class="trait" href="trait.Future.html" title="trait futures::future::Future">Future</a> + ?Sized,</span></h3></section></div><script src="../../implementors/futures_util/future/future/trait.FutureExt.js" async></script></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="futures" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.66.0-nightly (5c8bff74b 2022-10-21)" ></div></body></html> |