Files
google-apis-rs/futures/future/trait.TryFutureExt.html
2024-03-05 21:06:01 +01:00

310 lines
74 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

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

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Adapters specific to `Result`-returning futures"><title>TryFutureExt in futures::future - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-ac92e1bbe349e143.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="futures" data-themes="" data-resource-suffix="" data-rustdoc-version="1.76.0 (07dca489a 2024-02-04)" data-channel="1.76.0" data-search-js="search-2b6ce74ff89ae146.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../static.files/storage-f2adc0d6ca4d09fb.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-305769736d49e732.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-feafe1bb7466e4bd.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.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">&#9776;</button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../futures/index.html">futures</a><span class="version">0.3.28</span></h2></div><h2 class="location"><a href="#">TryFutureExt</a></h2><div class="sidebar-elems"><section><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.and_then">and_then</a></li><li><a href="#method.err_into">err_into</a></li><li><a href="#method.flatten_sink">flatten_sink</a></li><li><a href="#method.inspect_err">inspect_err</a></li><li><a href="#method.inspect_ok">inspect_ok</a></li><li><a href="#method.into_future">into_future</a></li><li><a href="#method.map_err">map_err</a></li><li><a href="#method.map_ok">map_ok</a></li><li><a href="#method.map_ok_or_else">map_ok_or_else</a></li><li><a href="#method.ok_into">ok_into</a></li><li><a href="#method.or_else">or_else</a></li><li><a href="#method.try_flatten">try_flatten</a></li><li><a href="#method.try_flatten_stream">try_flatten_stream</a></li><li><a href="#method.try_poll_unpin">try_poll_unpin</a></li><li><a href="#method.unwrap_or_else">unwrap_or_else</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><h2><a href="index.html">In futures::future</a></h2></div></nav><div class="sidebar-resizer"></div>
<main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><div id="sidebar-button" tabindex="-1"><a href="../../futures/all.html" title="show sidebar"></a></div><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Trait <a href="../index.html">futures</a>::<wbr><a href="index.html">future</a>::<wbr><a class="trait" href="#">TryFutureExt</a><button id="copy-path" title="Copy item path to clipboard"><img src="../../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../../src/futures_util/future/try_future/mod.rs.html#137">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><pre class="rust item-decl"><code>pub trait TryFutureExt: <a class="trait" href="trait.TryFuture.html" title="trait futures::future::TryFuture">TryFuture</a> {
<details class="toggle type-contents-toggle"><summary class="hideme"><span>Show 15 methods</span></summary> // Provided methods
fn <a href="#method.flatten_sink" class="fn">flatten_sink</a>&lt;Item&gt;(self) -&gt; <a class="struct" href="struct.FlattenSink.html" title="struct futures::future::FlattenSink">FlattenSink</a>&lt;Self, Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Ok" title="type futures::future::TryFuture::Ok">Ok</a>&gt;
<span class="where">where Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Ok" title="type futures::future::TryFuture::Ok">Ok</a>: <a class="trait" href="../sink/trait.Sink.html" title="trait futures::sink::Sink">Sink</a>&lt;Item, Error = Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Error" title="type futures::future::TryFuture::Error">Error</a>&gt;,
Self: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.map_ok" class="fn">map_ok</a>&lt;T, F&gt;(self, f: F) -&gt; <a class="struct" href="struct.MapOk.html" title="struct futures::future::MapOk">MapOk</a>&lt;Self, F&gt; <a href="#" class="tooltip" data-notable-ty="MapOk&lt;Self, F&gt;"></a>
<span class="where">where F: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Ok" title="type futures::future::TryFuture::Ok">Ok</a>) -&gt; T,
Self: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.map_ok_or_else" class="fn">map_ok_or_else</a>&lt;T, E, F&gt;(self, e: E, f: F) -&gt; <a class="struct" href="struct.MapOkOrElse.html" title="struct futures::future::MapOkOrElse">MapOkOrElse</a>&lt;Self, F, E&gt; <a href="#" class="tooltip" data-notable-ty="MapOkOrElse&lt;Self, F, E&gt;"></a>
<span class="where">where F: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Ok" title="type futures::future::TryFuture::Ok">Ok</a>) -&gt; T,
E: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Error" title="type futures::future::TryFuture::Error">Error</a>) -&gt; T,
Self: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.map_err" class="fn">map_err</a>&lt;E, F&gt;(self, f: F) -&gt; <a class="struct" href="struct.MapErr.html" title="struct futures::future::MapErr">MapErr</a>&lt;Self, F&gt; <a href="#" class="tooltip" data-notable-ty="MapErr&lt;Self, F&gt;"></a>
<span class="where">where F: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Error" title="type futures::future::TryFuture::Error">Error</a>) -&gt; E,
Self: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.err_into" class="fn">err_into</a>&lt;E&gt;(self) -&gt; <a class="struct" href="struct.ErrInto.html" title="struct futures::future::ErrInto">ErrInto</a>&lt;Self, E&gt; <a href="#" class="tooltip" data-notable-ty="ErrInto&lt;Self, E&gt;"></a>
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Error" title="type futures::future::TryFuture::Error">Error</a>: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;E&gt;</span> { ... }
<span class="item-spacer"></span> fn <a href="#method.ok_into" class="fn">ok_into</a>&lt;U&gt;(self) -&gt; <a class="struct" href="struct.OkInto.html" title="struct futures::future::OkInto">OkInto</a>&lt;Self, U&gt; <a href="#" class="tooltip" data-notable-ty="OkInto&lt;Self, U&gt;"></a>
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Ok" title="type futures::future::TryFuture::Ok">Ok</a>: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt;</span> { ... }
<span class="item-spacer"></span> fn <a href="#method.and_then" class="fn">and_then</a>&lt;Fut, F&gt;(self, f: F) -&gt; <a class="struct" href="struct.AndThen.html" title="struct futures::future::AndThen">AndThen</a>&lt;Self, Fut, F&gt; <a href="#" class="tooltip" data-notable-ty="AndThen&lt;Self, Fut, F&gt;"></a>
<span class="where">where F: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Ok" title="type futures::future::TryFuture::Ok">Ok</a>) -&gt; Fut,
Fut: <a class="trait" href="trait.TryFuture.html" title="trait futures::future::TryFuture">TryFuture</a>&lt;Error = Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Error" title="type futures::future::TryFuture::Error">Error</a>&gt;,
Self: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.or_else" class="fn">or_else</a>&lt;Fut, F&gt;(self, f: F) -&gt; <a class="struct" href="struct.OrElse.html" title="struct futures::future::OrElse">OrElse</a>&lt;Self, Fut, F&gt; <a href="#" class="tooltip" data-notable-ty="OrElse&lt;Self, Fut, F&gt;"></a>
<span class="where">where F: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Error" title="type futures::future::TryFuture::Error">Error</a>) -&gt; Fut,
Fut: <a class="trait" href="trait.TryFuture.html" title="trait futures::future::TryFuture">TryFuture</a>&lt;Ok = Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Ok" title="type futures::future::TryFuture::Ok">Ok</a>&gt;,
Self: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.inspect_ok" class="fn">inspect_ok</a>&lt;F&gt;(self, f: F) -&gt; <a class="struct" href="struct.InspectOk.html" title="struct futures::future::InspectOk">InspectOk</a>&lt;Self, F&gt; <a href="#" class="tooltip" data-notable-ty="InspectOk&lt;Self, F&gt;"></a>
<span class="where">where F: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Ok" title="type futures::future::TryFuture::Ok">Ok</a>),
Self: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.inspect_err" class="fn">inspect_err</a>&lt;F&gt;(self, f: F) -&gt; <a class="struct" href="struct.InspectErr.html" title="struct futures::future::InspectErr">InspectErr</a>&lt;Self, F&gt; <a href="#" class="tooltip" data-notable-ty="InspectErr&lt;Self, F&gt;"></a>
<span class="where">where F: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Error" title="type futures::future::TryFuture::Error">Error</a>),
Self: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.try_flatten" class="fn">try_flatten</a>(self) -&gt; <a class="struct" href="struct.TryFlatten.html" title="struct futures::future::TryFlatten">TryFlatten</a>&lt;Self, Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Ok" title="type futures::future::TryFuture::Ok">Ok</a>&gt; <a href="#" class="tooltip" data-notable-ty="TryFlatten&lt;Self, Self::Ok&gt;"></a>
<span class="where">where Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Ok" title="type futures::future::TryFuture::Ok">Ok</a>: <a class="trait" href="trait.TryFuture.html" title="trait futures::future::TryFuture">TryFuture</a>&lt;Error = Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Error" title="type futures::future::TryFuture::Error">Error</a>&gt;,
Self: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.try_flatten_stream" class="fn">try_flatten_stream</a>(self) -&gt; <a class="struct" href="struct.TryFlattenStream.html" title="struct futures::future::TryFlattenStream">TryFlattenStream</a>&lt;Self&gt;
<span class="where">where Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Ok" title="type futures::future::TryFuture::Ok">Ok</a>: <a class="trait" href="../stream/trait.TryStream.html" title="trait futures::stream::TryStream">TryStream</a>&lt;Error = Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Error" title="type futures::future::TryFuture::Error">Error</a>&gt;,
Self: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.unwrap_or_else" class="fn">unwrap_or_else</a>&lt;F&gt;(self, f: F) -&gt; <a class="struct" href="struct.UnwrapOrElse.html" title="struct futures::future::UnwrapOrElse">UnwrapOrElse</a>&lt;Self, F&gt; <a href="#" class="tooltip" data-notable-ty="UnwrapOrElse&lt;Self, F&gt;"></a>
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
F: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Error" title="type futures::future::TryFuture::Error">Error</a>) -&gt; Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Ok" title="type futures::future::TryFuture::Ok">Ok</a></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.into_future" class="fn">into_future</a>(self) -&gt; <a class="struct" href="struct.IntoFuture.html" title="struct futures::future::IntoFuture">IntoFuture</a>&lt;Self&gt; <a href="#" class="tooltip" data-notable-ty="IntoFuture&lt;Self&gt;"></a>
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.try_poll_unpin" class="fn">try_poll_unpin</a>(
&amp;mut self,
cx: &amp;mut <a class="struct" href="../task/struct.Context.html" title="struct futures::task::Context">Context</a>&lt;'_&gt;
) -&gt; <a class="enum" href="../task/enum.Poll.html" title="enum futures::task::Poll">Poll</a>&lt;<a class="enum" href="https://doc.rust-lang.org/1.76.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Ok" title="type futures::future::TryFuture::Ok">Ok</a>, Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Error" title="type futures::future::TryFuture::Error">Error</a>&gt;&gt;
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a></span> { ... }
</details>}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Adapters specific to <a href="https://doc.rust-lang.org/1.76.0/core/result/enum.Result.html" title="enum core::result::Result"><code>Result</code></a>-returning futures</p>
</div></details><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.flatten_sink" class="method"><a class="src rightside" href="../../src/futures_util/future/try_future/mod.rs.html#171-174">source</a><h4 class="code-header">fn <a href="#method.flatten_sink" class="fn">flatten_sink</a>&lt;Item&gt;(self) -&gt; <a class="struct" href="struct.FlattenSink.html" title="struct futures::future::FlattenSink">FlattenSink</a>&lt;Self, Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Ok" title="type futures::future::TryFuture::Ok">Ok</a>&gt;<div class="where">where
Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Ok" title="type futures::future::TryFuture::Ok">Ok</a>: <a class="trait" href="../sink/trait.Sink.html" title="trait futures::sink::Sink">Sink</a>&lt;Item, Error = Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Error" title="type futures::future::TryFuture::Error">Error</a>&gt;,
Self: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Flattens the execution of this future when the successful result of this
future is a <a href="../sink/trait.Sink.html" title="trait futures::sink::Sink"><code>Sink</code></a>.</p>
<p>This can be useful when sink initialization is deferred, and it is
convenient to work with that sink as if the sink 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"><a href="#examples">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>futures::future::{Future, TryFutureExt};
<span class="kw">use </span>futures::sink::Sink;
<span class="kw">fn </span>make_sink_async() -&gt; <span class="kw">impl </span>Future&lt;Output = <span class="prelude-ty">Result</span>&lt;
<span class="kw">impl </span>Sink&lt;T, Error = E&gt;,
E,
&gt;&gt; { <span class="comment">// ... }
</span><span class="kw">fn </span>take_sink(sink: <span class="kw">impl </span>Sink&lt;T, Error = E&gt;) { <span class="comment">/* ... */ </span>}
<span class="kw">let </span>fut = make_sink_async();
take_sink(fut.flatten_sink())</code></pre></div>
</div></details><details class="toggle method-toggle" open><summary><section id="method.map_ok" class="method"><a class="src rightside" href="../../src/futures_util/future/try_future/mod.rs.html#217-220">source</a><h4 class="code-header">fn <a href="#method.map_ok" class="fn">map_ok</a>&lt;T, F&gt;(self, f: F) -&gt; <a class="struct" href="struct.MapOk.html" title="struct futures::future::MapOk">MapOk</a>&lt;Self, F&gt; <a href="#" class="tooltip" data-notable-ty="MapOk&lt;Self, F&gt;"></a><div class="where">where
F: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Ok" title="type futures::future::TryFuture::Ok">Ok</a>) -&gt; T,
Self: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Maps this futures success value to a different value.</p>
<p>This method can be used to change the <a href="trait.TryFuture.html#associatedtype.Ok" title="associated type futures::future::TryFuture::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/1.76.0/core/result/enum.Result.html#method.map" title="method core::result::Result::map"><code>Result::map</code></a>
method. You can use this method to chain along a computation once the
future has been resolved.</p>
<p>The provided closure <code>f</code> will only be called if this future is resolved
to an <a href="https://doc.rust-lang.org/1.76.0/core/result/enum.Result.html#variant.Ok" title="variant core::result::Result::Ok"><code>Ok</code></a>. If it resolves to an <a href="https://doc.rust-lang.org/1.76.0/core/result/enum.Result.html#variant.Err" title="variant core::result::Result::Err"><code>Err</code></a>, panics, or is dropped, then
the provided closure will never be invoked.</p>
<p>Note that this method consumes the future it is called on 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::TryFutureExt;
<span class="kw">let </span>future = <span class="kw">async </span>{ <span class="prelude-val">Ok</span>::&lt;i32, i32&gt;(<span class="number">1</span>) };
<span class="kw">let </span>future = future.map_ok(|x| x + <span class="number">3</span>);
<span class="macro">assert_eq!</span>(future.<span class="kw">await</span>, <span class="prelude-val">Ok</span>(<span class="number">4</span>));</code></pre></div>
<p>Calling <a href="trait.TryFutureExt.html#method.map_ok" title="method futures::future::TryFutureExt::map_ok"><code>map_ok</code></a> on an errored future has no
effect:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>futures::future::TryFutureExt;
<span class="kw">let </span>future = <span class="kw">async </span>{ <span class="prelude-val">Err</span>::&lt;i32, i32&gt;(<span class="number">1</span>) };
<span class="kw">let </span>future = future.map_ok(|x| x + <span class="number">3</span>);
<span class="macro">assert_eq!</span>(future.<span class="kw">await</span>, <span class="prelude-val">Err</span>(<span class="number">1</span>));</code></pre></div>
</div></details><details class="toggle method-toggle" open><summary><section id="method.map_ok_or_else" class="method"><a class="src rightside" href="../../src/futures_util/future/try_future/mod.rs.html#257-261">source</a><h4 class="code-header">fn <a href="#method.map_ok_or_else" class="fn">map_ok_or_else</a>&lt;T, E, F&gt;(self, e: E, f: F) -&gt; <a class="struct" href="struct.MapOkOrElse.html" title="struct futures::future::MapOkOrElse">MapOkOrElse</a>&lt;Self, F, E&gt; <a href="#" class="tooltip" data-notable-ty="MapOkOrElse&lt;Self, F, E&gt;"></a><div class="where">where
F: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Ok" title="type futures::future::TryFuture::Ok">Ok</a>) -&gt; T,
E: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Error" title="type futures::future::TryFuture::Error">Error</a>) -&gt; T,
Self: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Maps this futures 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="trait.TryFuture.html#associatedtype.Ok" title="associated type futures::future::TryFuture::Ok"><code>Ok</code></a> type and <a href="trait.TryFuture.html#associatedtype.Error" title="associated type futures::future::TryFuture::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
to an <a href="https://doc.rust-lang.org/1.76.0/core/result/enum.Result.html#variant.Ok" title="variant core::result::Result::Ok"><code>Ok</code></a>. If it resolves to an <a href="https://doc.rust-lang.org/1.76.0/core/result/enum.Result.html#variant.Err" title="variant core::result::Result::Err"><code>Err</code></a>, panics, or is dropped, then
the provided closure will never be invoked.</p>
<p>The provided closure <code>e</code> will only be called if this future is resolved
to an <a href="https://doc.rust-lang.org/1.76.0/core/result/enum.Result.html#variant.Err" title="variant core::result::Result::Err"><code>Err</code></a>. If it resolves to an <a href="https://doc.rust-lang.org/1.76.0/core/result/enum.Result.html#variant.Ok" title="variant core::result::Result::Ok"><code>Ok</code></a>, panics, or is dropped, then
the provided closure will never be invoked.</p>
<p>Note that this method consumes the future it is called on and returns a
wrapped version of it.</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::TryFutureExt;
<span class="kw">let </span>future = <span class="kw">async </span>{ <span class="prelude-val">Ok</span>::&lt;i32, i32&gt;(<span class="number">5</span>) };
<span class="kw">let </span>future = future.map_ok_or_else(|x| x * <span class="number">2</span>, |x| x + <span class="number">3</span>);
<span class="macro">assert_eq!</span>(future.<span class="kw">await</span>, <span class="number">8</span>);
<span class="kw">let </span>future = <span class="kw">async </span>{ <span class="prelude-val">Err</span>::&lt;i32, i32&gt;(<span class="number">5</span>) };
<span class="kw">let </span>future = future.map_ok_or_else(|x| x * <span class="number">2</span>, |x| x + <span class="number">3</span>);
<span class="macro">assert_eq!</span>(future.<span class="kw">await</span>, <span class="number">10</span>);</code></pre></div>
</div></details><details class="toggle method-toggle" open><summary><section id="method.map_err" class="method"><a class="src rightside" href="../../src/futures_util/future/try_future/mod.rs.html#308-311">source</a><h4 class="code-header">fn <a href="#method.map_err" class="fn">map_err</a>&lt;E, F&gt;(self, f: F) -&gt; <a class="struct" href="struct.MapErr.html" title="struct futures::future::MapErr">MapErr</a>&lt;Self, F&gt; <a href="#" class="tooltip" data-notable-ty="MapErr&lt;Self, F&gt;"></a><div class="where">where
F: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Error" title="type futures::future::TryFuture::Error">Error</a>) -&gt; E,
Self: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Maps this futures error value to a different value.</p>
<p>This method can be used to change the <a href="trait.TryFuture.html#associatedtype.Error" title="associated type futures::future::TryFuture::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/1.76.0/core/result/enum.Result.html#method.map_err" title="method core::result::Result::map_err"><code>Result::map_err</code></a> method. You can use this method for example to
ensure that futures have the same <a href="trait.TryFuture.html#associatedtype.Error" title="associated type futures::future::TryFuture::Error"><code>Error</code></a> type when
using <a href="../macro.select.html" title="macro futures::select"><code>select!</code></a> or <a href="../macro.join.html" title="macro futures::join"><code>join!</code></a>.</p>
<p>The provided closure <code>f</code> will only be called if this future is resolved
to an <a href="https://doc.rust-lang.org/1.76.0/core/result/enum.Result.html#variant.Err" title="variant core::result::Result::Err"><code>Err</code></a>. If it resolves to an <a href="https://doc.rust-lang.org/1.76.0/core/result/enum.Result.html#variant.Ok" title="variant core::result::Result::Ok"><code>Ok</code></a>, panics, or is dropped, then
the provided closure will never be invoked.</p>
<p>Note that this method consumes the future it is called on and returns a
wrapped version of it.</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::TryFutureExt;
<span class="kw">let </span>future = <span class="kw">async </span>{ <span class="prelude-val">Err</span>::&lt;i32, i32&gt;(<span class="number">1</span>) };
<span class="kw">let </span>future = future.map_err(|x| x + <span class="number">3</span>);
<span class="macro">assert_eq!</span>(future.<span class="kw">await</span>, <span class="prelude-val">Err</span>(<span class="number">4</span>));</code></pre></div>
<p>Calling <a href="trait.TryFutureExt.html#method.map_err" title="method futures::future::TryFutureExt::map_err"><code>map_err</code></a> on a successful future has
no effect:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>futures::future::TryFutureExt;
<span class="kw">let </span>future = <span class="kw">async </span>{ <span class="prelude-val">Ok</span>::&lt;i32, i32&gt;(<span class="number">1</span>) };
<span class="kw">let </span>future = future.map_err(|x| x + <span class="number">3</span>);
<span class="macro">assert_eq!</span>(future.<span class="kw">await</span>, <span class="prelude-val">Ok</span>(<span class="number">1</span>));</code></pre></div>
</div></details><details class="toggle method-toggle" open><summary><section id="method.err_into" class="method"><a class="src rightside" href="../../src/futures_util/future/try_future/mod.rs.html#341-344">source</a><h4 class="code-header">fn <a href="#method.err_into" class="fn">err_into</a>&lt;E&gt;(self) -&gt; <a class="struct" href="struct.ErrInto.html" title="struct futures::future::ErrInto">ErrInto</a>&lt;Self, E&gt; <a href="#" class="tooltip" data-notable-ty="ErrInto&lt;Self, E&gt;"></a><div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Error" title="type futures::future::TryFuture::Error">Error</a>: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;E&gt;,</div></h4></section></summary><div class="docblock"><p>Maps this futures <a href="trait.TryFuture.html#associatedtype.Error" title="associated type futures::future::TryFuture::Error"><code>Error</code></a> to a new error type
using the <a href="https://doc.rust-lang.org/1.76.0/core/convert/trait.Into.html" title="trait core::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/1.76.0/core/result/enum.Result.html" title="enum core::result::Result"><code>Result</code></a>: It lets the compiler infer the type of the resulting
error. Just as <a href="trait.TryFutureExt.html#method.map_err" title="method futures::future::TryFutureExt::map_err"><code>map_err</code></a>, this is useful for
example to ensure that futures have the same <a href="trait.TryFuture.html#associatedtype.Error" title="associated type futures::future::TryFuture::Error"><code>Error</code></a>
type when using <a href="../macro.select.html" title="macro futures::select"><code>select!</code></a> or <a href="../macro.join.html" title="macro futures::join"><code>join!</code></a>.</p>
<p>Note that this method consumes the future it is called on and returns a
wrapped version of it.</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::TryFutureExt;
<span class="kw">let </span>future_err_u8 = <span class="kw">async </span>{ <span class="prelude-val">Err</span>::&lt;(), u8&gt;(<span class="number">1</span>) };
<span class="kw">let </span>future_err_i32 = future_err_u8.err_into::&lt;i32&gt;();</code></pre></div>
</div></details><details class="toggle method-toggle" open><summary><section id="method.ok_into" class="method"><a class="src rightside" href="../../src/futures_util/future/try_future/mod.rs.html#351-354">source</a><h4 class="code-header">fn <a href="#method.ok_into" class="fn">ok_into</a>&lt;U&gt;(self) -&gt; <a class="struct" href="struct.OkInto.html" title="struct futures::future::OkInto">OkInto</a>&lt;Self, U&gt; <a href="#" class="tooltip" data-notable-ty="OkInto&lt;Self, U&gt;"></a><div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Ok" title="type futures::future::TryFuture::Ok">Ok</a>: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt;,</div></h4></section></summary><div class="docblock"><p>Maps this futures <a href="trait.TryFuture.html#associatedtype.Ok" title="associated type futures::future::TryFuture::Ok"><code>Ok</code></a> to a new type
using the <a href="https://doc.rust-lang.org/1.76.0/core/convert/trait.Into.html" title="trait core::convert::Into"><code>Into</code></a> trait.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.and_then" class="method"><a class="src rightside" href="../../src/futures_util/future/try_future/mod.rs.html#395-399">source</a><h4 class="code-header">fn <a href="#method.and_then" class="fn">and_then</a>&lt;Fut, F&gt;(self, f: F) -&gt; <a class="struct" href="struct.AndThen.html" title="struct futures::future::AndThen">AndThen</a>&lt;Self, Fut, F&gt; <a href="#" class="tooltip" data-notable-ty="AndThen&lt;Self, Fut, F&gt;"></a><div class="where">where
F: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Ok" title="type futures::future::TryFuture::Ok">Ok</a>) -&gt; Fut,
Fut: <a class="trait" href="trait.TryFuture.html" title="trait futures::future::TryFuture">TryFuture</a>&lt;Error = Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Error" title="type futures::future::TryFuture::Error">Error</a>&gt;,
Self: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><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>
<p>The provided closure <code>f</code> will only be called if this future is resolved
to an <a href="https://doc.rust-lang.org/1.76.0/core/result/enum.Result.html#variant.Ok" title="variant core::result::Result::Ok"><code>Ok</code></a>. If this future resolves to an <a href="https://doc.rust-lang.org/1.76.0/core/result/enum.Result.html#variant.Err" title="variant core::result::Result::Err"><code>Err</code></a>, panics, or is
dropped, then the provided closure will never be invoked. The
<a href="trait.TryFuture.html#associatedtype.Error" title="associated type futures::future::TryFuture::Error"><code>Error</code></a> type of this future and the future
returned by <code>f</code> have to match.</p>
<p>Note that this method consumes the future it is called on 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::TryFutureExt;
<span class="kw">let </span>future = <span class="kw">async </span>{ <span class="prelude-val">Ok</span>::&lt;i32, i32&gt;(<span class="number">1</span>) };
<span class="kw">let </span>future = future.and_then(|x| <span class="kw">async move </span>{ <span class="prelude-val">Ok</span>::&lt;i32, i32&gt;(x + <span class="number">3</span>) });
<span class="macro">assert_eq!</span>(future.<span class="kw">await</span>, <span class="prelude-val">Ok</span>(<span class="number">4</span>));</code></pre></div>
<p>Calling <a href="trait.TryFutureExt.html#method.and_then" title="method futures::future::TryFutureExt::and_then"><code>and_then</code></a> on an errored future has no
effect:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>futures::future::TryFutureExt;
<span class="kw">let </span>future = <span class="kw">async </span>{ <span class="prelude-val">Err</span>::&lt;i32, i32&gt;(<span class="number">1</span>) };
<span class="kw">let </span>future = future.and_then(|x| <span class="kw">async move </span>{ <span class="prelude-val">Err</span>::&lt;i32, i32&gt;(x + <span class="number">3</span>) });
<span class="macro">assert_eq!</span>(future.<span class="kw">await</span>, <span class="prelude-val">Err</span>(<span class="number">1</span>));</code></pre></div>
</div></details><details class="toggle method-toggle" open><summary><section id="method.or_else" class="method"><a class="src rightside" href="../../src/futures_util/future/try_future/mod.rs.html#440-444">source</a><h4 class="code-header">fn <a href="#method.or_else" class="fn">or_else</a>&lt;Fut, F&gt;(self, f: F) -&gt; <a class="struct" href="struct.OrElse.html" title="struct futures::future::OrElse">OrElse</a>&lt;Self, Fut, F&gt; <a href="#" class="tooltip" data-notable-ty="OrElse&lt;Self, Fut, F&gt;"></a><div class="where">where
F: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Error" title="type futures::future::TryFuture::Error">Error</a>) -&gt; Fut,
Fut: <a class="trait" href="trait.TryFuture.html" title="trait futures::future::TryFuture">TryFuture</a>&lt;Ok = Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Ok" title="type futures::future::TryFuture::Ok">Ok</a>&gt;,
Self: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Executes another future if this one resolves to an error. The
error value is passed to a closure to create this subsequent future.</p>
<p>The provided closure <code>f</code> will only be called if this future is resolved
to an <a href="https://doc.rust-lang.org/1.76.0/core/result/enum.Result.html#variant.Err" title="variant core::result::Result::Err"><code>Err</code></a>. If this future resolves to an <a href="https://doc.rust-lang.org/1.76.0/core/result/enum.Result.html#variant.Ok" title="variant core::result::Result::Ok"><code>Ok</code></a>, panics, or is
dropped, then the provided closure will never be invoked. The
<a href="trait.TryFuture.html#associatedtype.Ok" title="associated type futures::future::TryFuture::Ok"><code>Ok</code></a> type of this future and the future returned by <code>f</code>
have to match.</p>
<p>Note that this method consumes the future it is called on 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::TryFutureExt;
<span class="kw">let </span>future = <span class="kw">async </span>{ <span class="prelude-val">Err</span>::&lt;i32, i32&gt;(<span class="number">1</span>) };
<span class="kw">let </span>future = future.or_else(|x| <span class="kw">async move </span>{ <span class="prelude-val">Err</span>::&lt;i32, i32&gt;(x + <span class="number">3</span>) });
<span class="macro">assert_eq!</span>(future.<span class="kw">await</span>, <span class="prelude-val">Err</span>(<span class="number">4</span>));</code></pre></div>
<p>Calling <a href="trait.TryFutureExt.html#method.or_else" title="method futures::future::TryFutureExt::or_else"><code>or_else</code></a> on a successful future has
no effect:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>futures::future::TryFutureExt;
<span class="kw">let </span>future = <span class="kw">async </span>{ <span class="prelude-val">Ok</span>::&lt;i32, i32&gt;(<span class="number">1</span>) };
<span class="kw">let </span>future = future.or_else(|x| <span class="kw">async move </span>{ <span class="prelude-val">Ok</span>::&lt;i32, i32&gt;(x + <span class="number">3</span>) });
<span class="macro">assert_eq!</span>(future.<span class="kw">await</span>, <span class="prelude-val">Ok</span>(<span class="number">1</span>));</code></pre></div>
</div></details><details class="toggle method-toggle" open><summary><section id="method.inspect_ok" class="method"><a class="src rightside" href="../../src/futures_util/future/try_future/mod.rs.html#467-470">source</a><h4 class="code-header">fn <a href="#method.inspect_ok" class="fn">inspect_ok</a>&lt;F&gt;(self, f: F) -&gt; <a class="struct" href="struct.InspectOk.html" title="struct futures::future::InspectOk">InspectOk</a>&lt;Self, F&gt; <a href="#" class="tooltip" data-notable-ty="InspectOk&lt;Self, F&gt;"></a><div class="where">where
F: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Ok" title="type futures::future::TryFuture::Ok">Ok</a>),
Self: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><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
various parts in the pipeline, without consuming the intermediate
value. To do that, insert a call to <code>inspect_ok</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::TryFutureExt;
<span class="kw">let </span>future = <span class="kw">async </span>{ <span class="prelude-val">Ok</span>::&lt;<span class="kw">_</span>, ()&gt;(<span class="number">1</span>) };
<span class="kw">let </span>new_future = future.inspect_ok(|<span class="kw-2">&amp;</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="prelude-val">Ok</span>(<span class="number">1</span>));</code></pre></div>
</div></details><details class="toggle method-toggle" open><summary><section id="method.inspect_err" class="method"><a class="src rightside" href="../../src/futures_util/future/try_future/mod.rs.html#493-496">source</a><h4 class="code-header">fn <a href="#method.inspect_err" class="fn">inspect_err</a>&lt;F&gt;(self, f: F) -&gt; <a class="struct" href="struct.InspectErr.html" title="struct futures::future::InspectErr">InspectErr</a>&lt;Self, F&gt; <a href="#" class="tooltip" data-notable-ty="InspectErr&lt;Self, F&gt;"></a><div class="where">where
F: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Error" title="type futures::future::TryFuture::Error">Error</a>),
Self: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><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
various parts in the pipeline, without consuming the intermediate
value. To do that, insert a call to <code>inspect_err</code>.</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::TryFutureExt;
<span class="kw">let </span>future = <span class="kw">async </span>{ <span class="prelude-val">Err</span>::&lt;(), <span class="kw">_</span>&gt;(<span class="number">1</span>) };
<span class="kw">let </span>new_future = future.inspect_err(|<span class="kw-2">&amp;</span>x| <span class="macro">println!</span>(<span class="string">"about to error: {}"</span>, x));
<span class="macro">assert_eq!</span>(new_future.<span class="kw">await</span>, <span class="prelude-val">Err</span>(<span class="number">1</span>));</code></pre></div>
</div></details><details class="toggle method-toggle" open><summary><section id="method.try_flatten" class="method"><a class="src rightside" href="../../src/futures_util/future/try_future/mod.rs.html#505-508">source</a><h4 class="code-header">fn <a href="#method.try_flatten" class="fn">try_flatten</a>(self) -&gt; <a class="struct" href="struct.TryFlatten.html" title="struct futures::future::TryFlatten">TryFlatten</a>&lt;Self, Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Ok" title="type futures::future::TryFuture::Ok">Ok</a>&gt; <a href="#" class="tooltip" data-notable-ty="TryFlatten&lt;Self, Self::Ok&gt;"></a><div class="where">where
Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Ok" title="type futures::future::TryFuture::Ok">Ok</a>: <a class="trait" href="trait.TryFuture.html" title="trait futures::future::TryFuture">TryFuture</a>&lt;Error = Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Error" title="type futures::future::TryFuture::Error">Error</a>&gt;,
Self: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Flatten the execution of this future when the successful result of this
future is another future.</p>
<p>This is equivalent to <code>future.and_then(|x| x)</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.try_flatten_stream" class="method"><a class="src rightside" href="../../src/futures_util/future/try_future/mod.rs.html#538-541">source</a><h4 class="code-header">fn <a href="#method.try_flatten_stream" class="fn">try_flatten_stream</a>(self) -&gt; <a class="struct" href="struct.TryFlattenStream.html" title="struct futures::future::TryFlattenStream">TryFlattenStream</a>&lt;Self&gt;<div class="where">where
Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Ok" title="type futures::future::TryFuture::Ok">Ok</a>: <a class="trait" href="../stream/trait.TryStream.html" title="trait futures::stream::TryStream">TryStream</a>&lt;Error = Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Error" title="type futures::future::TryFuture::Error">Error</a>&gt;,
Self: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></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-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::TryFutureExt;
<span class="kw">use </span>futures::stream::{<span class="self">self</span>, TryStreamExt};
<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>].into_iter().map(<span class="prelude-val">Ok</span>);
<span class="kw">let </span>future_of_a_stream = <span class="kw">async </span>{ <span class="prelude-val">Ok</span>::&lt;<span class="kw">_</span>, ()&gt;(stream::iter(stream_items)) };
<span class="kw">let </span>stream = future_of_a_stream.try_flatten_stream();
<span class="kw">let </span>list = stream.try_collect::&lt;Vec&lt;<span class="kw">_</span>&gt;&gt;().<span class="kw">await</span>;
<span class="macro">assert_eq!</span>(list, <span class="prelude-val">Ok</span>(<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="toggle method-toggle" open><summary><section id="method.unwrap_or_else" class="method"><a class="src rightside" href="../../src/futures_util/future/try_future/mod.rs.html#570-573">source</a><h4 class="code-header">fn <a href="#method.unwrap_or_else" class="fn">unwrap_or_else</a>&lt;F&gt;(self, f: F) -&gt; <a class="struct" href="struct.UnwrapOrElse.html" title="struct futures::future::UnwrapOrElse">UnwrapOrElse</a>&lt;Self, F&gt; <a href="#" class="tooltip" data-notable-ty="UnwrapOrElse&lt;Self, F&gt;"></a><div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
F: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Error" title="type futures::future::TryFuture::Error">Error</a>) -&gt; Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Ok" title="type futures::future::TryFuture::Ok">Ok</a>,</div></h4></section></summary><div class="docblock"><p>Unwraps this futures output, producing a future with this futures
<a href="trait.TryFuture.html#associatedtype.Ok" title="associated type futures::future::TryFuture::Ok"><code>Ok</code></a> type as its
<a href="trait.Future.html#associatedtype.Output" title="associated type futures::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
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/1.76.0/core/result/enum.Result.html#method.unwrap_or_else" title="method core::result::Result::unwrap_or_else"><code>Result::unwrap_or_else</code></a> method.</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::TryFutureExt;
<span class="kw">let </span>future = <span class="kw">async </span>{ <span class="prelude-val">Err</span>::&lt;(), <span class="kw-2">&amp;</span>str&gt;(<span class="string">"Boom!"</span>) };
<span class="kw">let </span>future = future.unwrap_or_else(|<span class="kw">_</span>| ());
<span class="macro">assert_eq!</span>(future.<span class="kw">await</span>, ());</code></pre></div>
</div></details><details class="toggle method-toggle" open><summary><section id="method.into_future" class="method"><a class="src rightside" href="../../src/futures_util/future/try_future/mod.rs.html#610-612">source</a><h4 class="code-header">fn <a href="#method.into_future" class="fn">into_future</a>(self) -&gt; <a class="struct" href="struct.IntoFuture.html" title="struct futures::future::IntoFuture">IntoFuture</a>&lt;Self&gt; <a href="#" class="tooltip" data-notable-ty="IntoFuture&lt;Self&gt;"></a><div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Wraps a <a href="trait.TryFuture.html" title="trait futures::future::TryFuture"><code>TryFuture</code></a> into a type that implements
<a href="trait.Future.html" title="trait futures::future::Future"><code>Future</code></a>.</p>
<p><a href="trait.TryFuture.html" title="trait futures::future::TryFuture"><code>TryFuture</code></a>s currently do not implement the
<a href="trait.Future.html" title="trait futures::future::Future"><code>Future</code></a> trait due to limitations of the
compiler.</p>
<h5 id="examples-11"><a href="#examples-11">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>futures::future::{Future, TryFuture, TryFutureExt};
<span class="kw">fn </span>make_try_future() -&gt; <span class="kw">impl </span>TryFuture&lt;<span class="prelude-val">Ok </span>= T, Error = E&gt; { <span class="comment">// ... }
</span><span class="kw">fn </span>take_future(future: <span class="kw">impl </span>Future&lt;Output = <span class="prelude-ty">Result</span>&lt;T, E&gt;&gt;) { <span class="comment">/* ... */ </span>}
take_future(make_try_future().into_future());</code></pre></div>
</div></details><details class="toggle method-toggle" open><summary><section id="method.try_poll_unpin" class="method"><a class="src rightside" href="../../src/futures_util/future/try_future/mod.rs.html#619-621">source</a><h4 class="code-header">fn <a href="#method.try_poll_unpin" class="fn">try_poll_unpin</a>(
&amp;mut self,
cx: &amp;mut <a class="struct" href="../task/struct.Context.html" title="struct futures::task::Context">Context</a>&lt;'_&gt;
) -&gt; <a class="enum" href="../task/enum.Poll.html" title="enum futures::task::Poll">Poll</a>&lt;<a class="enum" href="https://doc.rust-lang.org/1.76.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Ok" title="type futures::future::TryFuture::Ok">Ok</a>, Self::<a class="associatedtype" href="trait.TryFuture.html#associatedtype.Error" title="type futures::future::TryFuture::Error">Error</a>&gt;&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class="docblock"><p>A convenience method for calling <a href="trait.TryFuture.html#tymethod.try_poll" title="method futures::future::TryFuture::try_poll"><code>TryFuture::try_poll</code></a> on <a href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin"><code>Unpin</code></a>
future types.</p>
</div></details></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-TryFutureExt-for-Fut" class="impl"><a class="src rightside" href="../../src/futures_util/future/try_future/mod.rs.html#134">source</a><a href="#impl-TryFutureExt-for-Fut" class="anchor">§</a><h3 class="code-header">impl&lt;Fut&gt; <a class="trait" href="trait.TryFutureExt.html" title="trait futures::future::TryFutureExt">TryFutureExt</a> for Fut<div class="where">where
Fut: <a class="trait" href="trait.TryFuture.html" title="trait futures::future::TryFuture">TryFuture</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></div><script src="../../trait.impl/futures_util/future/try_future/trait.TryFutureExt.js" async></script><script type="text/json" id="notable-traits-data">{"AndThen<Self, Fut, F>":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.AndThen.html\" title=\"struct futures::future::AndThen\">AndThen</a>&lt;Fut1, Fut2, F&gt;</code></h3><pre><code><div class=\"where\">impl&lt;Fut1, Fut2, F&gt; <a class=\"trait\" href=\"trait.Future.html\" title=\"trait futures::future::Future\">Future</a> for <a class=\"struct\" href=\"struct.AndThen.html\" title=\"struct futures::future::AndThen\">AndThen</a>&lt;Fut1, Fut2, F&gt;<div class=\"where\">where\n <a class=\"struct\" href=\"struct.TryFlatten.html\" title=\"struct futures::future::TryFlatten\">TryFlatten</a>&lt;<a class=\"struct\" href=\"struct.MapOk.html\" title=\"struct futures::future::MapOk\">MapOk</a>&lt;Fut1, F&gt;, Fut2&gt;: <a class=\"trait\" href=\"trait.Future.html\" title=\"trait futures::future::Future\">Future</a>,</div></div><div class=\"where\"> type <a href=\"trait.Future.html#associatedtype.Output\" class=\"associatedtype\">Output</a> = &lt;<a class=\"struct\" href=\"struct.TryFlatten.html\" title=\"struct futures::future::TryFlatten\">TryFlatten</a>&lt;<a class=\"struct\" href=\"struct.MapOk.html\" title=\"struct futures::future::MapOk\">MapOk</a>&lt;Fut1, F&gt;, Fut2&gt; as <a class=\"trait\" href=\"trait.Future.html\" title=\"trait futures::future::Future\">Future</a>&gt;::<a class=\"associatedtype\" href=\"trait.Future.html#associatedtype.Output\" title=\"type futures::future::Future::Output\">Output</a>;</div>","ErrInto<Self, E>":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.ErrInto.html\" title=\"struct futures::future::ErrInto\">ErrInto</a>&lt;Fut, E&gt;</code></h3><pre><code><div class=\"where\">impl&lt;Fut, E&gt; <a class=\"trait\" href=\"trait.Future.html\" title=\"trait futures::future::Future\">Future</a> for <a class=\"struct\" href=\"struct.ErrInto.html\" title=\"struct futures::future::ErrInto\">ErrInto</a>&lt;Fut, E&gt;<div class=\"where\">where\n <a class=\"struct\" href=\"struct.MapErr.html\" title=\"struct futures::future::MapErr\">MapErr</a>&lt;Fut, IntoFn&lt;E&gt;&gt;: <a class=\"trait\" href=\"trait.Future.html\" title=\"trait futures::future::Future\">Future</a>,</div></div><div class=\"where\"> type <a href=\"trait.Future.html#associatedtype.Output\" class=\"associatedtype\">Output</a> = &lt;<a class=\"struct\" href=\"struct.MapErr.html\" title=\"struct futures::future::MapErr\">MapErr</a>&lt;Fut, IntoFn&lt;E&gt;&gt; as <a class=\"trait\" href=\"trait.Future.html\" title=\"trait futures::future::Future\">Future</a>&gt;::<a class=\"associatedtype\" href=\"trait.Future.html#associatedtype.Output\" title=\"type futures::future::Future::Output\">Output</a>;</div>","InspectErr<Self, F>":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.InspectErr.html\" title=\"struct futures::future::InspectErr\">InspectErr</a>&lt;Fut, F&gt;</code></h3><pre><code><div class=\"where\">impl&lt;Fut, F&gt; <a class=\"trait\" href=\"trait.Future.html\" title=\"trait futures::future::Future\">Future</a> for <a class=\"struct\" href=\"struct.InspectErr.html\" title=\"struct futures::future::InspectErr\">InspectErr</a>&lt;Fut, F&gt;<div class=\"where\">where\n <a class=\"struct\" href=\"struct.Inspect.html\" title=\"struct futures::future::Inspect\">Inspect</a>&lt;<a class=\"struct\" href=\"struct.IntoFuture.html\" title=\"struct futures::future::IntoFuture\">IntoFuture</a>&lt;Fut&gt;, InspectErrFn&lt;F&gt;&gt;: <a class=\"trait\" href=\"trait.Future.html\" title=\"trait futures::future::Future\">Future</a>,</div></div><div class=\"where\"> type <a href=\"trait.Future.html#associatedtype.Output\" class=\"associatedtype\">Output</a> = &lt;<a class=\"struct\" href=\"struct.Inspect.html\" title=\"struct futures::future::Inspect\">Inspect</a>&lt;<a class=\"struct\" href=\"struct.IntoFuture.html\" title=\"struct futures::future::IntoFuture\">IntoFuture</a>&lt;Fut&gt;, InspectErrFn&lt;F&gt;&gt; as <a class=\"trait\" href=\"trait.Future.html\" title=\"trait futures::future::Future\">Future</a>&gt;::<a class=\"associatedtype\" href=\"trait.Future.html#associatedtype.Output\" title=\"type futures::future::Future::Output\">Output</a>;</div>","InspectOk<Self, F>":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.InspectOk.html\" title=\"struct futures::future::InspectOk\">InspectOk</a>&lt;Fut, F&gt;</code></h3><pre><code><div class=\"where\">impl&lt;Fut, F&gt; <a class=\"trait\" href=\"trait.Future.html\" title=\"trait futures::future::Future\">Future</a> for <a class=\"struct\" href=\"struct.InspectOk.html\" title=\"struct futures::future::InspectOk\">InspectOk</a>&lt;Fut, F&gt;<div class=\"where\">where\n <a class=\"struct\" href=\"struct.Inspect.html\" title=\"struct futures::future::Inspect\">Inspect</a>&lt;<a class=\"struct\" href=\"struct.IntoFuture.html\" title=\"struct futures::future::IntoFuture\">IntoFuture</a>&lt;Fut&gt;, InspectOkFn&lt;F&gt;&gt;: <a class=\"trait\" href=\"trait.Future.html\" title=\"trait futures::future::Future\">Future</a>,</div></div><div class=\"where\"> type <a href=\"trait.Future.html#associatedtype.Output\" class=\"associatedtype\">Output</a> = &lt;<a class=\"struct\" href=\"struct.Inspect.html\" title=\"struct futures::future::Inspect\">Inspect</a>&lt;<a class=\"struct\" href=\"struct.IntoFuture.html\" title=\"struct futures::future::IntoFuture\">IntoFuture</a>&lt;Fut&gt;, InspectOkFn&lt;F&gt;&gt; as <a class=\"trait\" href=\"trait.Future.html\" title=\"trait futures::future::Future\">Future</a>&gt;::<a class=\"associatedtype\" href=\"trait.Future.html#associatedtype.Output\" title=\"type futures::future::Future::Output\">Output</a>;</div>","IntoFuture<Self>":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.IntoFuture.html\" title=\"struct futures::future::IntoFuture\">IntoFuture</a>&lt;Fut&gt;</code></h3><pre><code><div class=\"where\">impl&lt;Fut&gt; <a class=\"trait\" href=\"trait.Future.html\" title=\"trait futures::future::Future\">Future</a> for <a class=\"struct\" href=\"struct.IntoFuture.html\" title=\"struct futures::future::IntoFuture\">IntoFuture</a>&lt;Fut&gt;<div class=\"where\">where\n Fut: <a class=\"trait\" href=\"trait.TryFuture.html\" title=\"trait futures::future::TryFuture\">TryFuture</a>,</div></div><div class=\"where\"> type <a href=\"trait.Future.html#associatedtype.Output\" class=\"associatedtype\">Output</a> = <a class=\"enum\" href=\"https://doc.rust-lang.org/1.76.0/core/result/enum.Result.html\" title=\"enum core::result::Result\">Result</a>&lt;&lt;Fut as <a class=\"trait\" href=\"trait.TryFuture.html\" title=\"trait futures::future::TryFuture\">TryFuture</a>&gt;::<a class=\"associatedtype\" href=\"trait.TryFuture.html#associatedtype.Ok\" title=\"type futures::future::TryFuture::Ok\">Ok</a>, &lt;Fut as <a class=\"trait\" href=\"trait.TryFuture.html\" title=\"trait futures::future::TryFuture\">TryFuture</a>&gt;::<a class=\"associatedtype\" href=\"trait.TryFuture.html#associatedtype.Error\" title=\"type futures::future::TryFuture::Error\">Error</a>&gt;;</div>","MapErr<Self, F>":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.MapErr.html\" title=\"struct futures::future::MapErr\">MapErr</a>&lt;Fut, F&gt;</code></h3><pre><code><div class=\"where\">impl&lt;Fut, F&gt; <a class=\"trait\" href=\"trait.Future.html\" title=\"trait futures::future::Future\">Future</a> for <a class=\"struct\" href=\"struct.MapErr.html\" title=\"struct futures::future::MapErr\">MapErr</a>&lt;Fut, F&gt;<div class=\"where\">where\n <a class=\"struct\" href=\"struct.Map.html\" title=\"struct futures::future::Map\">Map</a>&lt;<a class=\"struct\" href=\"struct.IntoFuture.html\" title=\"struct futures::future::IntoFuture\">IntoFuture</a>&lt;Fut&gt;, MapErrFn&lt;F&gt;&gt;: <a class=\"trait\" href=\"trait.Future.html\" title=\"trait futures::future::Future\">Future</a>,</div></div><div class=\"where\"> type <a href=\"trait.Future.html#associatedtype.Output\" class=\"associatedtype\">Output</a> = &lt;<a class=\"struct\" href=\"struct.Map.html\" title=\"struct futures::future::Map\">Map</a>&lt;<a class=\"struct\" href=\"struct.IntoFuture.html\" title=\"struct futures::future::IntoFuture\">IntoFuture</a>&lt;Fut&gt;, MapErrFn&lt;F&gt;&gt; as <a class=\"trait\" href=\"trait.Future.html\" title=\"trait futures::future::Future\">Future</a>&gt;::<a class=\"associatedtype\" href=\"trait.Future.html#associatedtype.Output\" title=\"type futures::future::Future::Output\">Output</a>;</div>","MapOk<Self, F>":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.MapOk.html\" title=\"struct futures::future::MapOk\">MapOk</a>&lt;Fut, F&gt;</code></h3><pre><code><div class=\"where\">impl&lt;Fut, F&gt; <a class=\"trait\" href=\"trait.Future.html\" title=\"trait futures::future::Future\">Future</a> for <a class=\"struct\" href=\"struct.MapOk.html\" title=\"struct futures::future::MapOk\">MapOk</a>&lt;Fut, F&gt;<div class=\"where\">where\n <a class=\"struct\" href=\"struct.Map.html\" title=\"struct futures::future::Map\">Map</a>&lt;<a class=\"struct\" href=\"struct.IntoFuture.html\" title=\"struct futures::future::IntoFuture\">IntoFuture</a>&lt;Fut&gt;, MapOkFn&lt;F&gt;&gt;: <a class=\"trait\" href=\"trait.Future.html\" title=\"trait futures::future::Future\">Future</a>,</div></div><div class=\"where\"> type <a href=\"trait.Future.html#associatedtype.Output\" class=\"associatedtype\">Output</a> = &lt;<a class=\"struct\" href=\"struct.Map.html\" title=\"struct futures::future::Map\">Map</a>&lt;<a class=\"struct\" href=\"struct.IntoFuture.html\" title=\"struct futures::future::IntoFuture\">IntoFuture</a>&lt;Fut&gt;, MapOkFn&lt;F&gt;&gt; as <a class=\"trait\" href=\"trait.Future.html\" title=\"trait futures::future::Future\">Future</a>&gt;::<a class=\"associatedtype\" href=\"trait.Future.html#associatedtype.Output\" title=\"type futures::future::Future::Output\">Output</a>;</div>","MapOkOrElse<Self, F, E>":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.MapOkOrElse.html\" title=\"struct futures::future::MapOkOrElse\">MapOkOrElse</a>&lt;Fut, F, G&gt;</code></h3><pre><code><div class=\"where\">impl&lt;Fut, F, G&gt; <a class=\"trait\" href=\"trait.Future.html\" title=\"trait futures::future::Future\">Future</a> for <a class=\"struct\" href=\"struct.MapOkOrElse.html\" title=\"struct futures::future::MapOkOrElse\">MapOkOrElse</a>&lt;Fut, F, G&gt;<div class=\"where\">where\n <a class=\"struct\" href=\"struct.Map.html\" title=\"struct futures::future::Map\">Map</a>&lt;<a class=\"struct\" href=\"struct.IntoFuture.html\" title=\"struct futures::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=\"trait.Future.html\" title=\"trait futures::future::Future\">Future</a>,</div></div><div class=\"where\"> type <a href=\"trait.Future.html#associatedtype.Output\" class=\"associatedtype\">Output</a> = &lt;<a class=\"struct\" href=\"struct.Map.html\" title=\"struct futures::future::Map\">Map</a>&lt;<a class=\"struct\" href=\"struct.IntoFuture.html\" title=\"struct futures::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=\"trait.Future.html\" title=\"trait futures::future::Future\">Future</a>&gt;::<a class=\"associatedtype\" href=\"trait.Future.html#associatedtype.Output\" title=\"type futures::future::Future::Output\">Output</a>;</div>","OkInto<Self, U>":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.OkInto.html\" title=\"struct futures::future::OkInto\">OkInto</a>&lt;Fut, E&gt;</code></h3><pre><code><div class=\"where\">impl&lt;Fut, E&gt; <a class=\"trait\" href=\"trait.Future.html\" title=\"trait futures::future::Future\">Future</a> for <a class=\"struct\" href=\"struct.OkInto.html\" title=\"struct futures::future::OkInto\">OkInto</a>&lt;Fut, E&gt;<div class=\"where\">where\n <a class=\"struct\" href=\"struct.MapOk.html\" title=\"struct futures::future::MapOk\">MapOk</a>&lt;Fut, IntoFn&lt;E&gt;&gt;: <a class=\"trait\" href=\"trait.Future.html\" title=\"trait futures::future::Future\">Future</a>,</div></div><div class=\"where\"> type <a href=\"trait.Future.html#associatedtype.Output\" class=\"associatedtype\">Output</a> = &lt;<a class=\"struct\" href=\"struct.MapOk.html\" title=\"struct futures::future::MapOk\">MapOk</a>&lt;Fut, IntoFn&lt;E&gt;&gt; as <a class=\"trait\" href=\"trait.Future.html\" title=\"trait futures::future::Future\">Future</a>&gt;::<a class=\"associatedtype\" href=\"trait.Future.html#associatedtype.Output\" title=\"type futures::future::Future::Output\">Output</a>;</div>","OrElse<Self, Fut, F>":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.OrElse.html\" title=\"struct futures::future::OrElse\">OrElse</a>&lt;Fut1, Fut2, F&gt;</code></h3><pre><code><div class=\"where\">impl&lt;Fut1, Fut2, F&gt; <a class=\"trait\" href=\"trait.Future.html\" title=\"trait futures::future::Future\">Future</a> for <a class=\"struct\" href=\"struct.OrElse.html\" title=\"struct futures::future::OrElse\">OrElse</a>&lt;Fut1, Fut2, F&gt;<div class=\"where\">where\n TryFlattenErr&lt;<a class=\"struct\" href=\"struct.MapErr.html\" title=\"struct futures::future::MapErr\">MapErr</a>&lt;Fut1, F&gt;, Fut2&gt;: <a class=\"trait\" href=\"trait.Future.html\" title=\"trait futures::future::Future\">Future</a>,</div></div><div class=\"where\"> type <a href=\"trait.Future.html#associatedtype.Output\" class=\"associatedtype\">Output</a> = &lt;TryFlattenErr&lt;<a class=\"struct\" href=\"struct.MapErr.html\" title=\"struct futures::future::MapErr\">MapErr</a>&lt;Fut1, F&gt;, Fut2&gt; as <a class=\"trait\" href=\"trait.Future.html\" title=\"trait futures::future::Future\">Future</a>&gt;::<a class=\"associatedtype\" href=\"trait.Future.html#associatedtype.Output\" title=\"type futures::future::Future::Output\">Output</a>;</div>","TryFlatten<Self, Self::Ok>":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.TryFlatten.html\" title=\"struct futures::future::TryFlatten\">TryFlatten</a>&lt;Fut1, Fut2&gt;</code></h3><pre><code><div class=\"where\">impl&lt;Fut1, Fut2&gt; <a class=\"trait\" href=\"trait.Future.html\" title=\"trait futures::future::Future\">Future</a> for <a class=\"struct\" href=\"struct.TryFlatten.html\" title=\"struct futures::future::TryFlatten\">TryFlatten</a>&lt;Fut1, Fut2&gt;<div class=\"where\">where\n TryFlatten&lt;Fut1, Fut2&gt;: <a class=\"trait\" href=\"trait.Future.html\" title=\"trait futures::future::Future\">Future</a>,</div></div><div class=\"where\"> type <a href=\"trait.Future.html#associatedtype.Output\" class=\"associatedtype\">Output</a> = &lt;TryFlatten&lt;Fut1, Fut2&gt; as <a class=\"trait\" href=\"trait.Future.html\" title=\"trait futures::future::Future\">Future</a>&gt;::<a class=\"associatedtype\" href=\"trait.Future.html#associatedtype.Output\" title=\"type futures::future::Future::Output\">Output</a>;</div>","UnwrapOrElse<Self, F>":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.UnwrapOrElse.html\" title=\"struct futures::future::UnwrapOrElse\">UnwrapOrElse</a>&lt;Fut, F&gt;</code></h3><pre><code><div class=\"where\">impl&lt;Fut, F&gt; <a class=\"trait\" href=\"trait.Future.html\" title=\"trait futures::future::Future\">Future</a> for <a class=\"struct\" href=\"struct.UnwrapOrElse.html\" title=\"struct futures::future::UnwrapOrElse\">UnwrapOrElse</a>&lt;Fut, F&gt;<div class=\"where\">where\n <a class=\"struct\" href=\"struct.Map.html\" title=\"struct futures::future::Map\">Map</a>&lt;<a class=\"struct\" href=\"struct.IntoFuture.html\" title=\"struct futures::future::IntoFuture\">IntoFuture</a>&lt;Fut&gt;, UnwrapOrElseFn&lt;F&gt;&gt;: <a class=\"trait\" href=\"trait.Future.html\" title=\"trait futures::future::Future\">Future</a>,</div></div><div class=\"where\"> type <a href=\"trait.Future.html#associatedtype.Output\" class=\"associatedtype\">Output</a> = &lt;<a class=\"struct\" href=\"struct.Map.html\" title=\"struct futures::future::Map\">Map</a>&lt;<a class=\"struct\" href=\"struct.IntoFuture.html\" title=\"struct futures::future::IntoFuture\">IntoFuture</a>&lt;Fut&gt;, UnwrapOrElseFn&lt;F&gt;&gt; as <a class=\"trait\" href=\"trait.Future.html\" title=\"trait futures::future::Future\">Future</a>&gt;::<a class=\"associatedtype\" href=\"trait.Future.html#associatedtype.Output\" title=\"type futures::future::Future::Output\">Output</a>;</div>"}</script></section></div></main></body></html>