Auto Generated Documentation

This commit is contained in:
github-actions[bot]
2021-03-14 20:06:11 +00:00
parent fcf47cbac9
commit 799a22692f
11450 changed files with 65837 additions and 83717 deletions
@@ -1,7 +1,7 @@
<!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="Adapters specific to [`Result`]-returning futures"><meta name="keywords" content="rust, rustlang, rust-lang, TryFutureExt"><title>futures_util::future::TryFutureExt - 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">
<!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 `TryFutureExt` trait in crate `futures_util`."><meta name="keywords" content="rust, rustlang, rust-lang, TryFutureExt"><title>futures_util::future::TryFutureExt - 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 trait"><!--[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">Trait TryFutureExt</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#provided-methods">Provided Methods</a><div class="sidebar-links"><a href="#method.and_then">and_then</a><a href="#method.into_future">into_future</a><a href="#method.try_flatten">try_flatten</a><a href="#method.map_ok">map_ok</a><a href="#method.map_ok_or_else">map_ok_or_else</a><a href="#method.map_err">map_err</a><a href="#method.err_into">err_into</a><a href="#method.ok_into">ok_into</a><a href="#method.or_else">or_else</a><a href="#method.inspect_ok">inspect_ok</a><a href="#method.inspect_err">inspect_err</a><a href="#method.try_flatten_stream">try_flatten_stream</a><a href="#method.unwrap_or_else">unwrap_or_else</a><a href="#method.try_poll_unpin">try_poll_unpin</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class="location"><a href="../index.html">futures_util</a>::<wbr><a href="index.html">future</a></p><div id="sidebar-vars" data-name="TryFutureExt" data-ty="trait" data-relpath=""></div><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="in-band">Trait <a href="../index.html">futures_util</a>::<wbr><a href="index.html">future</a>::<wbr><a class="trait" href="">TryFutureExt</a></span><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/try_future/mod.rs.html#137-619" title="goto source code">[src]</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust trait">pub trait TryFutureExt: <a class="trait" href="../../futures_util/future/trait.TryFuture.html" title="trait futures_util::future::TryFuture">TryFuture</a> {
<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 trait"><!--[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">Trait TryFutureExt</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#provided-methods">Provided Methods</a><div class="sidebar-links"><a href="#method.and_then">and_then</a><a href="#method.err_into">err_into</a><a href="#method.inspect_err">inspect_err</a><a href="#method.inspect_ok">inspect_ok</a><a href="#method.into_future">into_future</a><a href="#method.map_err">map_err</a><a href="#method.map_ok">map_ok</a><a href="#method.map_ok_or_else">map_ok_or_else</a><a href="#method.ok_into">ok_into</a><a href="#method.or_else">or_else</a><a href="#method.try_flatten">try_flatten</a><a href="#method.try_flatten_stream">try_flatten_stream</a><a href="#method.try_poll_unpin">try_poll_unpin</a><a href="#method.unwrap_or_else">unwrap_or_else</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class="location"><a href="../index.html">futures_util</a>::<wbr><a href="index.html">future</a></p><script>window.sidebarCurrent = {name: "TryFutureExt", ty: "trait", 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/try_future/mod.rs.html#137-619" title="goto source code">[src]</a></span><span class="in-band">Trait <a href="../index.html">futures_util</a>::<wbr><a href="index.html">future</a>::<wbr><a class="trait" href="">TryFutureExt</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust trait">pub trait TryFutureExt: <a class="trait" href="../../futures_util/future/trait.TryFuture.html" title="trait futures_util::future::TryFuture">TryFuture</a> {
fn <a href="#method.map_ok" class="fnname">map_ok</a>&lt;T, F&gt;(self, f: F) -&gt; <a class="struct" href="../../futures_util/future/struct.MapOk.html" title="struct futures_util::future::MapOk">MapOk</a>&lt;Self, F&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../../futures_util/future/struct.MapOk.html" title="struct futures_util::future::MapOk">MapOk</a>&lt;Fut, F&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;Fut, F&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a> for <a class="struct" href="../../futures_util/future/struct.MapOk.html" title="struct futures_util::future::MapOk">MapOk</a>&lt;Fut, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;<a class="struct" href="../../futures_util/future/struct.Map.html" title="struct futures_util::future::Map">Map</a>&lt;<a class="struct" href="../../futures_util/future/struct.IntoFuture.html" title="struct futures_util::future::IntoFuture">IntoFuture</a>&lt;Fut&gt;, MapOkFn&lt;F&gt;&gt;: <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>,&nbsp;</span></span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = &lt;<a class="struct" href="../../futures_util/future/struct.Map.html" title="struct futures_util::future::Map">Map</a>&lt;<a class="struct" href="../../futures_util/future/struct.IntoFuture.html" title="struct futures_util::future::IntoFuture">IntoFuture</a>&lt;Fut&gt;, MapOkFn&lt;F&gt;&gt; as <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" title="type core::future::future::Future::Output">Output</a>;</span></code></span></div></span></span><br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(Self::<a class="type" href="../../futures_util/future/trait.TryFuture.html#associatedtype.Ok" title="type futures_util::future::TryFuture::Ok">Ok</a>) -&gt; T,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
{ ... }
<div class="item-spacer"></div> fn <a href="#method.map_ok_or_else" class="fnname">map_ok_or_else</a>&lt;T, E, F&gt;(self, e: E, f: F) -&gt; <a class="struct" href="../../futures_util/future/struct.MapOkOrElse.html" title="struct futures_util::future::MapOkOrElse">MapOkOrElse</a>&lt;Self, F, E&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../../futures_util/future/struct.MapOkOrElse.html" title="struct futures_util::future::MapOkOrElse">MapOkOrElse</a>&lt;Fut, F, G&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;Fut, F, G&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a> for <a class="struct" href="../../futures_util/future/struct.MapOkOrElse.html" title="struct futures_util::future::MapOkOrElse">MapOkOrElse</a>&lt;Fut, F, G&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;<a class="struct" href="../../futures_util/future/struct.Map.html" title="struct futures_util::future::Map">Map</a>&lt;<a class="struct" href="../../futures_util/future/struct.IntoFuture.html" title="struct futures_util::future::IntoFuture">IntoFuture</a>&lt;Fut&gt;, ChainFn&lt;MapOkFn&lt;F&gt;, ChainFn&lt;MapErrFn&lt;G&gt;, MergeResultFn&gt;&gt;&gt;: <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>,&nbsp;</span></span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = &lt;<a class="struct" href="../../futures_util/future/struct.Map.html" title="struct futures_util::future::Map">Map</a>&lt;<a class="struct" href="../../futures_util/future/struct.IntoFuture.html" title="struct futures_util::future::IntoFuture">IntoFuture</a>&lt;Fut&gt;, ChainFn&lt;MapOkFn&lt;F&gt;, ChainFn&lt;MapErrFn&lt;G&gt;, MergeResultFn&gt;&gt;&gt; as <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" title="type core::future::future::Future::Output">Output</a>;</span></code></span></div></span></span><br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(Self::<a class="type" href="../../futures_util/future/trait.TryFuture.html#associatedtype.Ok" title="type futures_util::future::TryFuture::Ok">Ok</a>) -&gt; T,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(Self::<a class="type" href="../../futures_util/future/trait.TryFuture.html#associatedtype.Error" title="type futures_util::future::TryFuture::Error">Error</a>) -&gt; T,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
@@ -31,7 +31,7 @@
<div class="item-spacer"></div> fn <a href="#method.try_poll_unpin" class="fnname">try_poll_unpin</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="type" href="../../futures_util/future/trait.TryFuture.html#associatedtype.Ok" title="type futures_util::future::TryFuture::Ok">Ok</a>, Self::<a class="type" href="../../futures_util/future/trait.TryFuture.html#associatedtype.Error" title="type futures_util::future::TryFuture::Error">Error</a>&gt;&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a></span>,
{ ... }
}</pre></div><div class="docblock"><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>
</div><h2 id="provided-methods" class="small-section-header">Provided methods<a href="#provided-methods" class="anchor"></a></h2><div class="methods"><h3 id="method.map_ok" class="method"><code>fn <a href="#method.map_ok" class="fnname">map_ok</a>&lt;T, F&gt;(self, f: F) -&gt; <a class="struct" href="../../futures_util/future/struct.MapOk.html" title="struct futures_util::future::MapOk">MapOk</a>&lt;Self, F&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../../futures_util/future/struct.MapOk.html" title="struct futures_util::future::MapOk">MapOk</a>&lt;Fut, F&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;Fut, F&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a> for <a class="struct" href="../../futures_util/future/struct.MapOk.html" title="struct futures_util::future::MapOk">MapOk</a>&lt;Fut, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;<a class="struct" href="../../futures_util/future/struct.Map.html" title="struct futures_util::future::Map">Map</a>&lt;<a class="struct" href="../../futures_util/future/struct.IntoFuture.html" title="struct futures_util::future::IntoFuture">IntoFuture</a>&lt;Fut&gt;, MapOkFn&lt;F&gt;&gt;: <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>,&nbsp;</span></span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = &lt;<a class="struct" href="../../futures_util/future/struct.Map.html" title="struct futures_util::future::Map">Map</a>&lt;<a class="struct" href="../../futures_util/future/struct.IntoFuture.html" title="struct futures_util::future::IntoFuture">IntoFuture</a>&lt;Fut&gt;, MapOkFn&lt;F&gt;&gt; as <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" title="type core::future::future::Future::Output">Output</a>;</span></code></span></div></span></span> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(Self::<a class="type" href="../../futures_util/future/trait.TryFuture.html#associatedtype.Ok" title="type futures_util::future::TryFuture::Ok">Ok</a>) -&gt; T,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a class="srclink" href="../../src/futures_util/future/try_future/mod.rs.html#217-223" title="goto source code">[src]</a></h3><div class="docblock"><p>Maps this futures success value to a different value.</p>
</div><h2 id="provided-methods" class="small-section-header">Provided methods<a href="#provided-methods" class="anchor"></a></h2><div class="methods"><h3 id="method.map_ok" class="method"><code>fn <a href="#method.map_ok" class="fnname">map_ok</a>&lt;T, F&gt;(self, f: F) -&gt; <a class="struct" href="../../futures_util/future/struct.MapOk.html" title="struct futures_util::future::MapOk">MapOk</a>&lt;Self, F&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../../futures_util/future/struct.MapOk.html" title="struct futures_util::future::MapOk">MapOk</a>&lt;Fut, F&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;Fut, F&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a> for <a class="struct" href="../../futures_util/future/struct.MapOk.html" title="struct futures_util::future::MapOk">MapOk</a>&lt;Fut, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;<a class="struct" href="../../futures_util/future/struct.Map.html" title="struct futures_util::future::Map">Map</a>&lt;<a class="struct" href="../../futures_util/future/struct.IntoFuture.html" title="struct futures_util::future::IntoFuture">IntoFuture</a>&lt;Fut&gt;, MapOkFn&lt;F&gt;&gt;: <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>,&nbsp;</span></span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = &lt;<a class="struct" href="../../futures_util/future/struct.Map.html" title="struct futures_util::future::Map">Map</a>&lt;<a class="struct" href="../../futures_util/future/struct.IntoFuture.html" title="struct futures_util::future::IntoFuture">IntoFuture</a>&lt;Fut&gt;, MapOkFn&lt;F&gt;&gt; as <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" title="type core::future::future::Future::Output">Output</a>;</span></code></span></div></span></span> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(Self::<a class="type" href="../../futures_util/future/trait.TryFuture.html#associatedtype.Ok" title="type futures_util::future::TryFuture::Ok">Ok</a>) -&gt; T,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a class="srclink" href="../../src/futures_util/future/try_future/mod.rs.html#217-223" title="goto source code">[src]</a></h3><div class="docblock"><p>Maps this future's success value to a different value.</p>
<p>This method can be used to change the <a href="../../futures_util/future/trait.TryFuture.html#associatedtype.Ok"><code>Ok</code></a> type of the
future into a different type. It is similar to the <a href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html#method.map" title="Result::map"><code>Result::map</code></a>
method. You can use this method to chain along a computation once the
@@ -57,7 +57,7 @@ effect:</p>
<span class="kw">let</span> <span class="ident">future</span> <span class="op">=</span> <span class="kw">async</span> { <span class="prelude-val">Err</span>::<span class="op">&lt;</span><span class="ident">i32</span>, <span class="ident">i32</span><span class="op">&gt;</span>(<span class="number">1</span>) };
<span class="kw">let</span> <span class="ident">future</span> <span class="op">=</span> <span class="ident">future</span>.<span class="ident">map_ok</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="ident">x</span> <span class="op">+</span> <span class="number">3</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">future</span>.<span class="kw">await</span>, <span class="prelude-val">Err</span>(<span class="number">1</span>));</pre></div>
</div><h3 id="method.map_ok_or_else" class="method"><code>fn <a href="#method.map_ok_or_else" class="fnname">map_ok_or_else</a>&lt;T, E, F&gt;(self, e: E, f: F) -&gt; <a class="struct" href="../../futures_util/future/struct.MapOkOrElse.html" title="struct futures_util::future::MapOkOrElse">MapOkOrElse</a>&lt;Self, F, E&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../../futures_util/future/struct.MapOkOrElse.html" title="struct futures_util::future::MapOkOrElse">MapOkOrElse</a>&lt;Fut, F, G&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;Fut, F, G&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a> for <a class="struct" href="../../futures_util/future/struct.MapOkOrElse.html" title="struct futures_util::future::MapOkOrElse">MapOkOrElse</a>&lt;Fut, F, G&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;<a class="struct" href="../../futures_util/future/struct.Map.html" title="struct futures_util::future::Map">Map</a>&lt;<a class="struct" href="../../futures_util/future/struct.IntoFuture.html" title="struct futures_util::future::IntoFuture">IntoFuture</a>&lt;Fut&gt;, ChainFn&lt;MapOkFn&lt;F&gt;, ChainFn&lt;MapErrFn&lt;G&gt;, MergeResultFn&gt;&gt;&gt;: <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>,&nbsp;</span></span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = &lt;<a class="struct" href="../../futures_util/future/struct.Map.html" title="struct futures_util::future::Map">Map</a>&lt;<a class="struct" href="../../futures_util/future/struct.IntoFuture.html" title="struct futures_util::future::IntoFuture">IntoFuture</a>&lt;Fut&gt;, ChainFn&lt;MapOkFn&lt;F&gt;, ChainFn&lt;MapErrFn&lt;G&gt;, MergeResultFn&gt;&gt;&gt; as <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" title="type core::future::future::Future::Output">Output</a>;</span></code></span></div></span></span> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(Self::<a class="type" href="../../futures_util/future/trait.TryFuture.html#associatedtype.Ok" title="type futures_util::future::TryFuture::Ok">Ok</a>) -&gt; T,<br>&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(Self::<a class="type" href="../../futures_util/future/trait.TryFuture.html#associatedtype.Error" title="type futures_util::future::TryFuture::Error">Error</a>) -&gt; T,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a class="srclink" href="../../src/futures_util/future/try_future/mod.rs.html#257-264" title="goto source code">[src]</a></h3><div class="docblock"><p>Maps this futures success value to a different value, and permits for error handling resulting in the same type.</p>
</div><h3 id="method.map_ok_or_else" class="method"><code>fn <a href="#method.map_ok_or_else" class="fnname">map_ok_or_else</a>&lt;T, E, F&gt;(self, e: E, f: F) -&gt; <a class="struct" href="../../futures_util/future/struct.MapOkOrElse.html" title="struct futures_util::future::MapOkOrElse">MapOkOrElse</a>&lt;Self, F, E&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../../futures_util/future/struct.MapOkOrElse.html" title="struct futures_util::future::MapOkOrElse">MapOkOrElse</a>&lt;Fut, F, G&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;Fut, F, G&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a> for <a class="struct" href="../../futures_util/future/struct.MapOkOrElse.html" title="struct futures_util::future::MapOkOrElse">MapOkOrElse</a>&lt;Fut, F, G&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;<a class="struct" href="../../futures_util/future/struct.Map.html" title="struct futures_util::future::Map">Map</a>&lt;<a class="struct" href="../../futures_util/future/struct.IntoFuture.html" title="struct futures_util::future::IntoFuture">IntoFuture</a>&lt;Fut&gt;, ChainFn&lt;MapOkFn&lt;F&gt;, ChainFn&lt;MapErrFn&lt;G&gt;, MergeResultFn&gt;&gt;&gt;: <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>,&nbsp;</span></span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = &lt;<a class="struct" href="../../futures_util/future/struct.Map.html" title="struct futures_util::future::Map">Map</a>&lt;<a class="struct" href="../../futures_util/future/struct.IntoFuture.html" title="struct futures_util::future::IntoFuture">IntoFuture</a>&lt;Fut&gt;, ChainFn&lt;MapOkFn&lt;F&gt;, ChainFn&lt;MapErrFn&lt;G&gt;, MergeResultFn&gt;&gt;&gt; as <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" title="type core::future::future::Future::Output">Output</a>;</span></code></span></div></span></span> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(Self::<a class="type" href="../../futures_util/future/trait.TryFuture.html#associatedtype.Ok" title="type futures_util::future::TryFuture::Ok">Ok</a>) -&gt; T,<br>&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(Self::<a class="type" href="../../futures_util/future/trait.TryFuture.html#associatedtype.Error" title="type futures_util::future::TryFuture::Error">Error</a>) -&gt; T,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a class="srclink" href="../../src/futures_util/future/try_future/mod.rs.html#257-264" title="goto source code">[src]</a></h3><div class="docblock"><p>Maps this future's success value to a different value, and permits for error handling resulting in the same type.</p>
<p>This method can be used to coalesce your <a href="../../futures_util/future/trait.TryFuture.html#associatedtype.Ok"><code>Ok</code></a> type and <a href="../../futures_util/future/trait.TryFuture.html#associatedtype.Error"><code>Error</code></a> into another type,
where that type is the same for both outcomes.</p>
<p>The provided closure <code>f</code> will only be called if this future is resolved
@@ -79,7 +79,7 @@ wrapped version of it.</p>
<span class="kw">let</span> <span class="ident">future</span> <span class="op">=</span> <span class="kw">async</span> { <span class="prelude-val">Err</span>::<span class="op">&lt;</span><span class="ident">i32</span>, <span class="ident">i32</span><span class="op">&gt;</span>(<span class="number">5</span>) };
<span class="kw">let</span> <span class="ident">future</span> <span class="op">=</span> <span class="ident">future</span>.<span class="ident">map_ok_or_else</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="ident">x</span> <span class="op">*</span> <span class="number">2</span>, <span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="ident">x</span> <span class="op">+</span> <span class="number">3</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">future</span>.<span class="kw">await</span>, <span class="number">10</span>);</pre></div>
</div><h3 id="method.map_err" class="method"><code>fn <a href="#method.map_err" class="fnname">map_err</a>&lt;E, F&gt;(self, f: F) -&gt; <a class="struct" href="../../futures_util/future/struct.MapErr.html" title="struct futures_util::future::MapErr">MapErr</a>&lt;Self, F&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../../futures_util/future/struct.MapErr.html" title="struct futures_util::future::MapErr">MapErr</a>&lt;Fut, F&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;Fut, F&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a> for <a class="struct" href="../../futures_util/future/struct.MapErr.html" title="struct futures_util::future::MapErr">MapErr</a>&lt;Fut, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;<a class="struct" href="../../futures_util/future/struct.Map.html" title="struct futures_util::future::Map">Map</a>&lt;<a class="struct" href="../../futures_util/future/struct.IntoFuture.html" title="struct futures_util::future::IntoFuture">IntoFuture</a>&lt;Fut&gt;, MapErrFn&lt;F&gt;&gt;: <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>,&nbsp;</span></span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = &lt;<a class="struct" href="../../futures_util/future/struct.Map.html" title="struct futures_util::future::Map">Map</a>&lt;<a class="struct" href="../../futures_util/future/struct.IntoFuture.html" title="struct futures_util::future::IntoFuture">IntoFuture</a>&lt;Fut&gt;, MapErrFn&lt;F&gt;&gt; as <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" title="type core::future::future::Future::Output">Output</a>;</span></code></span></div></span></span> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(Self::<a class="type" href="../../futures_util/future/trait.TryFuture.html#associatedtype.Error" title="type futures_util::future::TryFuture::Error">Error</a>) -&gt; E,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a class="srclink" href="../../src/futures_util/future/try_future/mod.rs.html#305-311" title="goto source code">[src]</a></h3><div class="docblock"><p>Maps this futures error value to a different value.</p>
</div><h3 id="method.map_err" class="method"><code>fn <a href="#method.map_err" class="fnname">map_err</a>&lt;E, F&gt;(self, f: F) -&gt; <a class="struct" href="../../futures_util/future/struct.MapErr.html" title="struct futures_util::future::MapErr">MapErr</a>&lt;Self, F&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../../futures_util/future/struct.MapErr.html" title="struct futures_util::future::MapErr">MapErr</a>&lt;Fut, F&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;Fut, F&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a> for <a class="struct" href="../../futures_util/future/struct.MapErr.html" title="struct futures_util::future::MapErr">MapErr</a>&lt;Fut, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;<a class="struct" href="../../futures_util/future/struct.Map.html" title="struct futures_util::future::Map">Map</a>&lt;<a class="struct" href="../../futures_util/future/struct.IntoFuture.html" title="struct futures_util::future::IntoFuture">IntoFuture</a>&lt;Fut&gt;, MapErrFn&lt;F&gt;&gt;: <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>,&nbsp;</span></span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = &lt;<a class="struct" href="../../futures_util/future/struct.Map.html" title="struct futures_util::future::Map">Map</a>&lt;<a class="struct" href="../../futures_util/future/struct.IntoFuture.html" title="struct futures_util::future::IntoFuture">IntoFuture</a>&lt;Fut&gt;, MapErrFn&lt;F&gt;&gt; as <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" title="type core::future::future::Future::Output">Output</a>;</span></code></span></div></span></span> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(Self::<a class="type" href="../../futures_util/future/trait.TryFuture.html#associatedtype.Error" title="type futures_util::future::TryFuture::Error">Error</a>) -&gt; E,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a class="srclink" href="../../src/futures_util/future/try_future/mod.rs.html#305-311" title="goto source code">[src]</a></h3><div class="docblock"><p>Maps this future's error value to a different value.</p>
<p>This method can be used to change the <a href="../../futures_util/future/trait.TryFuture.html#associatedtype.Error"><code>Error</code></a> type
of the future into a different type. It is similar to the
<a href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html#method.map_err" title="Result::map_err"><code>Result::map_err</code></a> method. You can use this method for example to
@@ -106,7 +106,7 @@ no effect:</p>
<span class="kw">let</span> <span class="ident">future</span> <span class="op">=</span> <span class="kw">async</span> { <span class="prelude-val">Ok</span>::<span class="op">&lt;</span><span class="ident">i32</span>, <span class="ident">i32</span><span class="op">&gt;</span>(<span class="number">1</span>) };
<span class="kw">let</span> <span class="ident">future</span> <span class="op">=</span> <span class="ident">future</span>.<span class="ident">map_err</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="ident">x</span> <span class="op">+</span> <span class="number">3</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">future</span>.<span class="kw">await</span>, <span class="prelude-val">Ok</span>(<span class="number">1</span>));</pre></div>
</div><h3 id="method.err_into" class="method"><code>fn <a href="#method.err_into" class="fnname">err_into</a>&lt;E&gt;(self) -&gt; <a class="struct" href="../../futures_util/future/struct.ErrInto.html" title="struct futures_util::future::ErrInto">ErrInto</a>&lt;Self, E&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../../futures_util/future/struct.ErrInto.html" title="struct futures_util::future::ErrInto">ErrInto</a>&lt;Fut, E&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;Fut, E&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a> for <a class="struct" href="../../futures_util/future/struct.ErrInto.html" title="struct futures_util::future::ErrInto">ErrInto</a>&lt;Fut, E&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;<a class="struct" href="../../futures_util/future/struct.MapErr.html" title="struct futures_util::future::MapErr">MapErr</a>&lt;Fut, IntoFn&lt;E&gt;&gt;: <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>,&nbsp;</span></span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = &lt;<a class="struct" href="../../futures_util/future/struct.MapErr.html" title="struct futures_util::future::MapErr">MapErr</a>&lt;Fut, IntoFn&lt;E&gt;&gt; as <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" title="type core::future::future::Future::Output">Output</a>;</span></code></span></div></span></span> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self::<a class="type" href="../../futures_util/future/trait.TryFuture.html#associatedtype.Error" title="type futures_util::future::TryFuture::Error">Error</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;E&gt;,&nbsp;</span></code><a class="srclink" href="../../src/futures_util/future/try_future/mod.rs.html#335-341" title="goto source code">[src]</a></h3><div class="docblock"><p>Maps this futures <a href="../../futures_util/future/trait.TryFuture.html#associatedtype.Error"><code>Error</code></a> to a new error type
</div><h3 id="method.err_into" class="method"><code>fn <a href="#method.err_into" class="fnname">err_into</a>&lt;E&gt;(self) -&gt; <a class="struct" href="../../futures_util/future/struct.ErrInto.html" title="struct futures_util::future::ErrInto">ErrInto</a>&lt;Self, E&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../../futures_util/future/struct.ErrInto.html" title="struct futures_util::future::ErrInto">ErrInto</a>&lt;Fut, E&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;Fut, E&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a> for <a class="struct" href="../../futures_util/future/struct.ErrInto.html" title="struct futures_util::future::ErrInto">ErrInto</a>&lt;Fut, E&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;<a class="struct" href="../../futures_util/future/struct.MapErr.html" title="struct futures_util::future::MapErr">MapErr</a>&lt;Fut, IntoFn&lt;E&gt;&gt;: <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>,&nbsp;</span></span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = &lt;<a class="struct" href="../../futures_util/future/struct.MapErr.html" title="struct futures_util::future::MapErr">MapErr</a>&lt;Fut, IntoFn&lt;E&gt;&gt; as <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" title="type core::future::future::Future::Output">Output</a>;</span></code></span></div></span></span> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self::<a class="type" href="../../futures_util/future/trait.TryFuture.html#associatedtype.Error" title="type futures_util::future::TryFuture::Error">Error</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;E&gt;,&nbsp;</span></code><a class="srclink" href="../../src/futures_util/future/try_future/mod.rs.html#335-341" title="goto source code">[src]</a></h3><div class="docblock"><p>Maps this future's <a href="../../futures_util/future/trait.TryFuture.html#associatedtype.Error"><code>Error</code></a> to a new error type
using the <a href="std::convert::Into"><code>Into</code></a> trait.</p>
<p>This method does for futures what the <code>?</code>-operator does for
<a href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="Result"><code>Result</code></a>: It lets the compiler infer the type of the resulting
@@ -121,7 +121,7 @@ wrapped version of it.</p>
<span class="kw">let</span> <span class="ident">future_err_u8</span> <span class="op">=</span> <span class="kw">async</span> { <span class="prelude-val">Err</span>::<span class="op">&lt;</span>(), <span class="ident">u8</span><span class="op">&gt;</span>(<span class="number">1</span>) };
<span class="kw">let</span> <span class="ident">future_err_i32</span> <span class="op">=</span> <span class="ident">future_err_u8</span>.<span class="ident">err_into</span>::<span class="op">&lt;</span><span class="ident">i32</span><span class="op">&gt;</span>();</pre></div>
</div><h3 id="method.ok_into" class="method"><code>fn <a href="#method.ok_into" class="fnname">ok_into</a>&lt;U&gt;(self) -&gt; <a class="struct" href="../../futures_util/future/struct.OkInto.html" title="struct futures_util::future::OkInto">OkInto</a>&lt;Self, U&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../../futures_util/future/struct.OkInto.html" title="struct futures_util::future::OkInto">OkInto</a>&lt;Fut, E&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;Fut, E&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a> for <a class="struct" href="../../futures_util/future/struct.OkInto.html" title="struct futures_util::future::OkInto">OkInto</a>&lt;Fut, E&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;<a class="struct" href="../../futures_util/future/struct.MapOk.html" title="struct futures_util::future::MapOk">MapOk</a>&lt;Fut, IntoFn&lt;E&gt;&gt;: <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>,&nbsp;</span></span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = &lt;<a class="struct" href="../../futures_util/future/struct.MapOk.html" title="struct futures_util::future::MapOk">MapOk</a>&lt;Fut, IntoFn&lt;E&gt;&gt; as <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" title="type core::future::future::Future::Output">Output</a>;</span></code></span></div></span></span> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self::<a class="type" href="../../futures_util/future/trait.TryFuture.html#associatedtype.Ok" title="type futures_util::future::TryFuture::Ok">Ok</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt;,&nbsp;</span></code><a class="srclink" href="../../src/futures_util/future/try_future/mod.rs.html#345-351" title="goto source code">[src]</a></h3><div class="docblock"><p>Maps this futures <a href="../../futures_util/future/trait.TryFuture.html#associatedtype.Ok"><code>Ok</code></a> to a new type
</div><h3 id="method.ok_into" class="method"><code>fn <a href="#method.ok_into" class="fnname">ok_into</a>&lt;U&gt;(self) -&gt; <a class="struct" href="../../futures_util/future/struct.OkInto.html" title="struct futures_util::future::OkInto">OkInto</a>&lt;Self, U&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../../futures_util/future/struct.OkInto.html" title="struct futures_util::future::OkInto">OkInto</a>&lt;Fut, E&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;Fut, E&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a> for <a class="struct" href="../../futures_util/future/struct.OkInto.html" title="struct futures_util::future::OkInto">OkInto</a>&lt;Fut, E&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;<a class="struct" href="../../futures_util/future/struct.MapOk.html" title="struct futures_util::future::MapOk">MapOk</a>&lt;Fut, IntoFn&lt;E&gt;&gt;: <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>,&nbsp;</span></span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = &lt;<a class="struct" href="../../futures_util/future/struct.MapOk.html" title="struct futures_util::future::MapOk">MapOk</a>&lt;Fut, IntoFn&lt;E&gt;&gt; as <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" title="type core::future::future::Future::Output">Output</a>;</span></code></span></div></span></span> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self::<a class="type" href="../../futures_util/future/trait.TryFuture.html#associatedtype.Ok" title="type futures_util::future::TryFuture::Ok">Ok</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt;,&nbsp;</span></code><a class="srclink" href="../../src/futures_util/future/try_future/mod.rs.html#345-351" title="goto source code">[src]</a></h3><div class="docblock"><p>Maps this future's <a href="../../futures_util/future/trait.TryFuture.html#associatedtype.Ok"><code>Ok</code></a> to a new type
using the <a href="std::convert::Into"><code>Into</code></a> trait.</p>
</div><h3 id="method.and_then" class="method"><code>fn <a href="#method.and_then" class="fnname">and_then</a>&lt;Fut, F&gt;(self, f: F) -&gt; <a class="struct" href="../../futures_util/future/struct.AndThen.html" title="struct futures_util::future::AndThen">AndThen</a>&lt;Self, Fut, F&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../../futures_util/future/struct.AndThen.html" title="struct futures_util::future::AndThen">AndThen</a>&lt;Fut1, Fut2, F&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;Fut1, Fut2, F&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a> for <a class="struct" href="../../futures_util/future/struct.AndThen.html" title="struct futures_util::future::AndThen">AndThen</a>&lt;Fut1, Fut2, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;<a class="struct" href="../../futures_util/future/struct.TryFlatten.html" title="struct futures_util::future::TryFlatten">TryFlatten</a>&lt;<a class="struct" href="../../futures_util/future/struct.MapOk.html" title="struct futures_util::future::MapOk">MapOk</a>&lt;Fut1, F&gt;, Fut2&gt;: <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>,&nbsp;</span></span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = &lt;<a class="struct" href="../../futures_util/future/struct.TryFlatten.html" title="struct futures_util::future::TryFlatten">TryFlatten</a>&lt;<a class="struct" href="../../futures_util/future/struct.MapOk.html" title="struct futures_util::future::MapOk">MapOk</a>&lt;Fut1, F&gt;, Fut2&gt; as <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" title="type core::future::future::Future::Output">Output</a>;</span></code></span></div></span></span> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(Self::<a class="type" href="../../futures_util/future/trait.TryFuture.html#associatedtype.Ok" title="type futures_util::future::TryFuture::Ok">Ok</a>) -&gt; Fut,<br>&nbsp;&nbsp;&nbsp;&nbsp;Fut: <a class="trait" href="../../futures_util/future/trait.TryFuture.html" title="trait futures_util::future::TryFuture">TryFuture</a>&lt;Error = Self::<a class="type" href="../../futures_util/future/trait.TryFuture.html#associatedtype.Error" title="type futures_util::future::TryFuture::Error">Error</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a class="srclink" href="../../src/futures_util/future/try_future/mod.rs.html#389-396" title="goto source code">[src]</a></h3><div class="docblock"><p>Executes another future after this one resolves successfully. The
success value is passed to a closure to create this subsequent future.</p>
@@ -174,8 +174,8 @@ no effect:</p>
<span class="kw">let</span> <span class="ident">future</span> <span class="op">=</span> <span class="ident">future</span>.<span class="ident">or_else</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="kw">async</span> <span class="kw">move</span> { <span class="prelude-val">Ok</span>::<span class="op">&lt;</span><span class="ident">i32</span>, <span class="ident">i32</span><span class="op">&gt;</span>(<span class="ident">x</span> <span class="op">+</span> <span class="number">3</span>) });
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">future</span>.<span class="kw">await</span>, <span class="prelude-val">Ok</span>(<span class="number">1</span>));</pre></div>
</div><h3 id="method.inspect_ok" class="method"><code>fn <a href="#method.inspect_ok" class="fnname">inspect_ok</a>&lt;F&gt;(self, f: F) -&gt; <a class="struct" href="../../futures_util/future/struct.InspectOk.html" title="struct futures_util::future::InspectOk">InspectOk</a>&lt;Self, F&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../../futures_util/future/struct.InspectOk.html" title="struct futures_util::future::InspectOk">InspectOk</a>&lt;Fut, F&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;Fut, F&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a> for <a class="struct" href="../../futures_util/future/struct.InspectOk.html" title="struct futures_util::future::InspectOk">InspectOk</a>&lt;Fut, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;<a class="struct" href="../../futures_util/future/struct.Inspect.html" title="struct futures_util::future::Inspect">Inspect</a>&lt;<a class="struct" href="../../futures_util/future/struct.IntoFuture.html" title="struct futures_util::future::IntoFuture">IntoFuture</a>&lt;Fut&gt;, InspectOkFn&lt;F&gt;&gt;: <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>,&nbsp;</span></span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = &lt;<a class="struct" href="../../futures_util/future/struct.Inspect.html" title="struct futures_util::future::Inspect">Inspect</a>&lt;<a class="struct" href="../../futures_util/future/struct.IntoFuture.html" title="struct futures_util::future::IntoFuture">IntoFuture</a>&lt;Fut&gt;, InspectOkFn&lt;F&gt;&gt; as <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" title="type core::future::future::Future::Output">Output</a>;</span></code></span></div></span></span> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;Self::<a class="type" href="../../futures_util/future/trait.TryFuture.html#associatedtype.Ok" title="type futures_util::future::TryFuture::Ok">Ok</a>),<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a class="srclink" href="../../src/futures_util/future/try_future/mod.rs.html#461-467" title="goto source code">[src]</a></h3><div class="docblock"><p>Do something with the success value of a future before passing it on.</p>
<p>When using futures, youll often chain several of them together. While
working on such code, you might want to check out whats happening at
<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_ok</code>.</p>
<h1 id="examples-6" class="section-header"><a href="#examples-6">Examples</a></h1>
@@ -186,8 +186,8 @@ value. To do that, insert a call to <code>inspect_ok</code>.</p>
<span class="kw">let</span> <span class="ident">new_future</span> <span class="op">=</span> <span class="ident">future</span>.<span class="ident">inspect_ok</span>(<span class="op">|</span><span class="kw-2">&amp;</span><span class="ident">x</span><span class="op">|</span> <span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;about to resolve: {}&quot;</span>, <span class="ident">x</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">new_future</span>.<span class="kw">await</span>, <span class="prelude-val">Ok</span>(<span class="number">1</span>));</pre></div>
</div><h3 id="method.inspect_err" class="method"><code>fn <a href="#method.inspect_err" class="fnname">inspect_err</a>&lt;F&gt;(self, f: F) -&gt; <a class="struct" href="../../futures_util/future/struct.InspectErr.html" title="struct futures_util::future::InspectErr">InspectErr</a>&lt;Self, F&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../../futures_util/future/struct.InspectErr.html" title="struct futures_util::future::InspectErr">InspectErr</a>&lt;Fut, F&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;Fut, F&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a> for <a class="struct" href="../../futures_util/future/struct.InspectErr.html" title="struct futures_util::future::InspectErr">InspectErr</a>&lt;Fut, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;<a class="struct" href="../../futures_util/future/struct.Inspect.html" title="struct futures_util::future::Inspect">Inspect</a>&lt;<a class="struct" href="../../futures_util/future/struct.IntoFuture.html" title="struct futures_util::future::IntoFuture">IntoFuture</a>&lt;Fut&gt;, InspectErrFn&lt;F&gt;&gt;: <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>,&nbsp;</span></span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = &lt;<a class="struct" href="../../futures_util/future/struct.Inspect.html" title="struct futures_util::future::Inspect">Inspect</a>&lt;<a class="struct" href="../../futures_util/future/struct.IntoFuture.html" title="struct futures_util::future::IntoFuture">IntoFuture</a>&lt;Fut&gt;, InspectErrFn&lt;F&gt;&gt; as <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" title="type core::future::future::Future::Output">Output</a>;</span></code></span></div></span></span> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;Self::<a class="type" href="../../futures_util/future/trait.TryFuture.html#associatedtype.Error" title="type futures_util::future::TryFuture::Error">Error</a>),<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a class="srclink" href="../../src/futures_util/future/try_future/mod.rs.html#487-493" title="goto source code">[src]</a></h3><div class="docblock"><p>Do something with the error value of a future before passing it on.</p>
<p>When using futures, youll often chain several of them together. While
working on such code, you might want to check out whats happening at
<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_err</code>.</p>
<h1 id="examples-7" class="section-header"><a href="#examples-7">Examples</a></h1>
@@ -218,11 +218,11 @@ version of it.</p>
<span class="kw">let</span> <span class="ident">stream</span> <span class="op">=</span> <span class="ident">future_of_a_stream</span>.<span class="ident">try_flatten_stream</span>();
<span class="kw">let</span> <span class="ident">list</span> <span class="op">=</span> <span class="ident">stream</span>.<span class="ident">try_collect</span>::<span class="op">&lt;</span><span class="ident">Vec</span><span class="op">&lt;</span><span class="kw">_</span><span class="op">&gt;</span><span class="op">&gt;</span>().<span class="kw">await</span>;
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">list</span>, <span class="prelude-val">Ok</span>(<span class="macro">vec</span><span class="macro">!</span>[<span class="number">17</span>, <span class="number">18</span>, <span class="number">19</span>]));</pre></div>
</div><h3 id="method.unwrap_or_else" class="method"><code>fn <a href="#method.unwrap_or_else" class="fnname">unwrap_or_else</a>&lt;F&gt;(self, f: F) -&gt; <a class="struct" href="../../futures_util/future/struct.UnwrapOrElse.html" title="struct futures_util::future::UnwrapOrElse">UnwrapOrElse</a>&lt;Self, F&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../../futures_util/future/struct.UnwrapOrElse.html" title="struct futures_util::future::UnwrapOrElse">UnwrapOrElse</a>&lt;Fut, F&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;Fut, F&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a> for <a class="struct" href="../../futures_util/future/struct.UnwrapOrElse.html" title="struct futures_util::future::UnwrapOrElse">UnwrapOrElse</a>&lt;Fut, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;<a class="struct" href="../../futures_util/future/struct.Map.html" title="struct futures_util::future::Map">Map</a>&lt;<a class="struct" href="../../futures_util/future/struct.IntoFuture.html" title="struct futures_util::future::IntoFuture">IntoFuture</a>&lt;Fut&gt;, UnwrapOrElseFn&lt;F&gt;&gt;: <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>,&nbsp;</span></span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = &lt;<a class="struct" href="../../futures_util/future/struct.Map.html" title="struct futures_util::future::Map">Map</a>&lt;<a class="struct" href="../../futures_util/future/struct.IntoFuture.html" title="struct futures_util::future::IntoFuture">IntoFuture</a>&lt;Fut&gt;, UnwrapOrElseFn&lt;F&gt;&gt; as <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" title="type core::future::future::Future::Output">Output</a>;</span></code></span></div></span></span> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(Self::<a class="type" href="../../futures_util/future/trait.TryFuture.html#associatedtype.Error" title="type futures_util::future::TryFuture::Error">Error</a>) -&gt; Self::<a class="type" href="../../futures_util/future/trait.TryFuture.html#associatedtype.Ok" title="type futures_util::future::TryFuture::Ok">Ok</a>,&nbsp;</span></code><a class="srclink" href="../../src/futures_util/future/try_future/mod.rs.html#564-570" title="goto source code">[src]</a></h3><div class="docblock"><p>Unwraps this futures output, producing a future with this futures
</div><h3 id="method.unwrap_or_else" class="method"><code>fn <a href="#method.unwrap_or_else" class="fnname">unwrap_or_else</a>&lt;F&gt;(self, f: F) -&gt; <a class="struct" href="../../futures_util/future/struct.UnwrapOrElse.html" title="struct futures_util::future::UnwrapOrElse">UnwrapOrElse</a>&lt;Self, F&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../../futures_util/future/struct.UnwrapOrElse.html" title="struct futures_util::future::UnwrapOrElse">UnwrapOrElse</a>&lt;Fut, F&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;Fut, F&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a> for <a class="struct" href="../../futures_util/future/struct.UnwrapOrElse.html" title="struct futures_util::future::UnwrapOrElse">UnwrapOrElse</a>&lt;Fut, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;<a class="struct" href="../../futures_util/future/struct.Map.html" title="struct futures_util::future::Map">Map</a>&lt;<a class="struct" href="../../futures_util/future/struct.IntoFuture.html" title="struct futures_util::future::IntoFuture">IntoFuture</a>&lt;Fut&gt;, UnwrapOrElseFn&lt;F&gt;&gt;: <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>,&nbsp;</span></span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = &lt;<a class="struct" href="../../futures_util/future/struct.Map.html" title="struct futures_util::future::Map">Map</a>&lt;<a class="struct" href="../../futures_util/future/struct.IntoFuture.html" title="struct futures_util::future::IntoFuture">IntoFuture</a>&lt;Fut&gt;, UnwrapOrElseFn&lt;F&gt;&gt; as <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" title="type core::future::future::Future::Output">Output</a>;</span></code></span></div></span></span> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(Self::<a class="type" href="../../futures_util/future/trait.TryFuture.html#associatedtype.Error" title="type futures_util::future::TryFuture::Error">Error</a>) -&gt; Self::<a class="type" href="../../futures_util/future/trait.TryFuture.html#associatedtype.Ok" title="type futures_util::future::TryFuture::Ok">Ok</a>,&nbsp;</span></code><a class="srclink" href="../../src/futures_util/future/try_future/mod.rs.html#564-570" title="goto source code">[src]</a></h3><div class="docblock"><p>Unwraps this future's output, producing a future with this future's
<a href="../../futures_util/future/trait.TryFuture.html#associatedtype.Ok"><code>Ok</code></a> type as its
<a href="std::future::Future::Output"><code>Output</code></a> type.</p>
<p>If this future is resolved successfully, the returned future will
contain the original futures success value as output. Otherwise, the
contain the original future's success value as output. Otherwise, the
closure <code>f</code> is called with the error value to produce an alternate
success value.</p>
<p>This method is similar to the <a href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html#method.unwrap_or_else" title="Result::unwrap_or_else"><code>Result::unwrap_or_else</code></a> method.</p>
@@ -248,5 +248,4 @@ compiler.</p>
<span class="ident">take_future</span>(<span class="ident">make_try_future</span>().<span class="ident">into_future</span>());</pre></div>
</div><h3 id="method.try_poll_unpin" class="method"><code>fn <a href="#method.try_poll_unpin" class="fnname">try_poll_unpin</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="type" href="../../futures_util/future/trait.TryFuture.html#associatedtype.Ok" title="type futures_util::future::TryFuture::Ok">Ok</a>, Self::<a class="type" href="../../futures_util/future/trait.TryFuture.html#associatedtype.Error" title="type futures_util::future::TryFuture::Error">Error</a>&gt;&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,&nbsp;</span></code><a class="srclink" href="../../src/futures_util/future/try_future/mod.rs.html#613-618" title="goto source code">[src]</a></h3><div class="docblock"><p>A convenience method for calling <a href="../../futures_util/future/trait.TryFuture.html#tymethod.try_poll" title="TryFuture::try_poll"><code>TryFuture::try_poll</code></a> on <a href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="Unpin"><code>Unpin</code></a>
future types.</p>
</div></div><span class="loading-content">Loading content...</span><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"><h3 id="impl-TryFutureExt" class="impl"><code class="in-band">impl&lt;Fut:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="../../futures_util/future/trait.TryFuture.html" title="trait futures_util::future::TryFuture">TryFuture</a>&gt; <a class="trait" href="../../futures_util/future/trait.TryFutureExt.html" title="trait futures_util::future::TryFutureExt">TryFutureExt</a> for Fut</code><a href="#impl-TryFutureExt" class="anchor"></a><a class="srclink" href="../../src/futures_util/future/try_future/mod.rs.html#134" title="goto source code">[src]</a></h3><div class="impl-items"></div></div><span class="loading-content">Loading content...</span><script type="text/javascript" src="../../implementors/futures_util/future/trait.TryFutureExt.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../../" data-current-crate="futures_util"></div>
<script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
</div></div><span class="loading-content">Loading content...</span><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"><h3 id="impl-TryFutureExt" class="impl"><code class="in-band">impl&lt;Fut:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="../../futures_util/future/trait.TryFuture.html" title="trait futures_util::future::TryFuture">TryFuture</a>&gt; TryFutureExt for Fut</code><a href="#impl-TryFutureExt" class="anchor"></a><a class="srclink" href="../../src/futures_util/future/try_future/mod.rs.html#134" title="goto source code">[src]</a></h3><div class="impl-items"></div></div><span class="loading-content">Loading content...</span><script type="text/javascript" src="../../implementors/futures_util/future/trait.TryFutureExt.js" async></script></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>