Files
mercator_service/tokio_timer/delay_queue/struct.DelayQueue.html

338 lines
96 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `DelayQueue` struct in crate `tokio_timer`."><meta name="keywords" content="rust, rustlang, rust-lang, DelayQueue"><title>tokio_timer::delay_queue::DelayQueue - 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="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[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='../../tokio_timer/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct DelayQueue</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.capacity">capacity</a><a href="#method.clear">clear</a><a href="#method.insert">insert</a><a href="#method.insert_at">insert_at</a><a href="#method.is_empty">is_empty</a><a href="#method.new">new</a><a href="#method.remove">remove</a><a href="#method.reserve">reserve</a><a href="#method.reset">reset</a><a href="#method.reset_at">reset_at</a><a href="#method.with_capacity">with_capacity</a><a href="#method.with_capacity_and_handle">with_capacity_and_handle</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Stream">Stream</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">!RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">!UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><p class='location'><a href='../index.html'>tokio_timer</a>::<wbr><a href='index.html'>delay_queue</a></p><script>window.sidebarCurrent = {name: 'DelayQueue', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></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><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/tokio_timer/delay_queue.rs.html#129-151' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../index.html'>tokio_timer</a>::<wbr><a href='index.html'>delay_queue</a>::<wbr><a class="struct" href=''>DelayQueue</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct DelayQueue&lt;T&gt; { /* fields omitted */ }</pre></div><div class='docblock'><p>A queue of delayed elements.</p>
<p>Once an element is inserted into the <code>DelayQueue</code>, it is yielded once the
specified deadline has been reached.</p>
<h1 id="usage" class="section-header"><a href="#usage">Usage</a></h1>
<p>Elements are inserted into <code>DelayQueue</code> using the <a href="#method.insert"><code>insert</code></a> or
<a href="#method.insert_at"><code>insert_at</code></a> methods. A deadline is provided with the item and a <a href="struct.Key.html"><code>Key</code></a> is
returned. The key is used to remove the entry or to change the deadline at
which it should be yielded back.</p>
<p>Once delays have been configured, the <code>DelayQueue</code> is used via its
<a href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html"><code>Stream</code></a> implementation. <a href="#method.poll"><code>poll</code></a> is called. If an entry has reached its
deadline, it is returned. If not, <code>Async::NotReady</code> indicating that the
current task will be notified once the deadline has been reached.</p>
<h1 id="stream-implementation" class="section-header"><a href="#stream-implementation"><code>Stream</code> implementation</a></h1>
<p>Items are retrieved from the queue via <a href="#method.poll"><code>Stream::poll</code></a>. If no delays have
expired, no items are returned. In this case, <code>NotReady</code> is returned and the
current task is registered to be notified once the next item's delay has
expired.</p>
<p>If no items are in the queue, i.e. <code>is_empty()</code> returns <code>true</code>, then <code>poll</code>
returns <code>Ready(None)</code>. This indicates that the stream has reached an end.
However, if a new item is inserted <em>after</em>, <code>poll</code> will once again start
returning items or `NotReady.</p>
<p>Items are returned ordered by their expirations. Items that are configured
to expire first will be returned first. There are no ordering guarantees
for items configured to expire the same instant. Also note that delays are
rounded to the closest millisecond.</p>
<h1 id="implementation" class="section-header"><a href="#implementation">Implementation</a></h1>
<p>The <code>DelayQueue</code> is backed by the same hashed timing wheel implementation as
<a href="../struct.Timer.html"><code>Timer</code></a> as such, it offers the same performance benefits. See <a href="../struct.Timer.html"><code>Timer</code></a>
for further implementation notes.</p>
<p>State associated with each entry is stored in a <a href="https://docs.rs/slab"><code>slab</code></a>. This allows
amortizing the cost of allocation. Space created for expired entries is
reused when inserting new entries.</p>
<p>Capacity can be checked using <a href="#method.capacity"><code>capacity</code></a> and allocated preemptively by using
the <a href="#method.reserve"><code>reserve</code></a> method.</p>
<h1 id="usage-1" class="section-header"><a href="#usage-1">Usage</a></h1>
<p>Using <code>DelayQueue</code> to manage cache entries.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="attribute">#[<span class="ident">macro_use</span>]</span>
<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">futures</span>;
<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">tokio</span>;
<span class="kw">use</span> <span class="ident">tokio</span>::<span class="ident">timer</span>::{<span class="ident">delay_queue</span>, <span class="ident">DelayQueue</span>, <span class="ident">Error</span>};
<span class="kw">use</span> <span class="ident">futures</span>::{<span class="ident">Async</span>, <span class="ident">Poll</span>, <span class="ident">Stream</span>};
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">HashMap</span>;
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">time</span>::<span class="ident">Duration</span>;
<span class="kw">struct</span> <span class="ident">Cache</span> {
<span class="ident">entries</span>: <span class="ident">HashMap</span><span class="op">&lt;</span><span class="ident">CacheKey</span>, (<span class="ident">Value</span>, <span class="ident">delay_queue</span>::<span class="ident">Key</span>)<span class="op">&gt;</span>,
<span class="ident">expirations</span>: <span class="ident">DelayQueue</span><span class="op">&lt;</span><span class="ident">CacheKey</span><span class="op">&gt;</span>,
}
<span class="kw">const</span> <span class="ident">TTL_SECS</span>: <span class="ident">u64</span> <span class="op">=</span> <span class="number">30</span>;
<span class="kw">impl</span> <span class="ident">Cache</span> {
<span class="kw">fn</span> <span class="ident">insert</span>(<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">key</span>: <span class="ident">CacheKey</span>, <span class="ident">value</span>: <span class="ident">Value</span>) {
<span class="kw">let</span> <span class="ident">delay</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">expirations</span>
.<span class="ident">insert</span>(<span class="ident">key</span>.<span class="ident">clone</span>(), <span class="ident">Duration</span>::<span class="ident">from_secs</span>(<span class="ident">TTL_SECS</span>));
<span class="self">self</span>.<span class="ident">entries</span>.<span class="ident">insert</span>(<span class="ident">key</span>, (<span class="ident">value</span>, <span class="ident">delay</span>));
}
<span class="kw">fn</span> <span class="ident">get</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">key</span>: <span class="kw-2">&amp;</span><span class="ident">CacheKey</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="prelude-ty">Option</span><span class="op">&lt;</span><span class="kw-2">&amp;</span><span class="ident">Value</span><span class="op">&gt;</span> {
<span class="self">self</span>.<span class="ident">entries</span>.<span class="ident">get</span>(<span class="ident">key</span>)
.<span class="ident">map</span>(<span class="op">|</span><span class="kw-2">&amp;</span>(<span class="kw-2">ref</span> <span class="ident">v</span>, <span class="kw">_</span>)<span class="op">|</span> <span class="ident">v</span>)
}
<span class="kw">fn</span> <span class="ident">remove</span>(<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">key</span>: <span class="kw-2">&amp;</span><span class="ident">CacheKey</span>) {
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>((<span class="kw">_</span>, <span class="ident">cache_key</span>)) <span class="op">=</span> <span class="self">self</span>.<span class="ident">entries</span>.<span class="ident">remove</span>(<span class="ident">key</span>) {
<span class="self">self</span>.<span class="ident">expirations</span>.<span class="ident">remove</span>(<span class="kw-2">&amp;</span><span class="ident">cache_key</span>);
}
}
<span class="kw">fn</span> <span class="ident">poll_purge</span>(<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="self">self</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">Poll</span><span class="op">&lt;</span>(), <span class="ident">Error</span><span class="op">&gt;</span> {
<span class="kw">while</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">entry</span>) <span class="op">=</span> <span class="macro">try_ready</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">expirations</span>.<span class="ident">poll</span>()) {
<span class="self">self</span>.<span class="ident">entries</span>.<span class="ident">remove</span>(<span class="ident">entry</span>.<span class="ident">get_ref</span>());
}
<span class="prelude-val">Ok</span>(<span class="ident">Async</span>::<span class="ident">Ready</span>(()))
}
}</pre></div>
</div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="struct" href="../../tokio_timer/delay_queue/struct.DelayQueue.html" title="struct tokio_timer::delay_queue::DelayQueue">DelayQueue</a>&lt;T&gt;</code><a href='#impl' class='anchor'></a><a class='srclink' href='../../src/tokio_timer/delay_queue.rs.html#211-710' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.new' class="method"><code id='new.v'>pub fn <a href='#method.new' class='fnname'>new</a>() -&gt; <a class="struct" href="../../tokio_timer/delay_queue/struct.DelayQueue.html" title="struct tokio_timer::delay_queue::DelayQueue">DelayQueue</a>&lt;T&gt;</code><a class='srclink' href='../../src/tokio_timer/delay_queue.rs.html#222-224' title='goto source code'>[src]</a></h4><div class='docblock'><p>Create a new, empty, <code>DelayQueue</code></p>
<p>The queue will not allocate storage until items are inserted into it.</p>
<h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">delay_queue</span>: <span class="ident">DelayQueue</span><span class="op">&lt;</span><span class="ident">u32</span><span class="op">&gt;</span> <span class="op">=</span> <span class="ident">DelayQueue</span>::<span class="ident">new</span>();</pre></div>
</div><h4 id='method.with_capacity_and_handle' class="method"><code id='with_capacity_and_handle.v'>pub fn <a href='#method.with_capacity_and_handle' class='fnname'>with_capacity_and_handle</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;capacity: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;handle: &amp;<a class="struct" href="../../tokio_timer/timer/struct.Handle.html" title="struct tokio_timer::timer::Handle">Handle</a><br>) -&gt; <a class="struct" href="../../tokio_timer/delay_queue/struct.DelayQueue.html" title="struct tokio_timer::delay_queue::DelayQueue">DelayQueue</a>&lt;T&gt;</code><a class='srclink' href='../../src/tokio_timer/delay_queue.rs.html#239-249' title='goto source code'>[src]</a></h4><div class='docblock'><p>Create a new, empty, <code>DelayQueue</code> backed by the specified timer.</p>
<p>The queue will not allocate storage until items are inserted into it.</p>
<h1 id="examples-1" class="section-header"><a href="#examples-1">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">tokio_timer</span>::<span class="ident">timer</span>::<span class="ident">Handle</span>;
<span class="kw">let</span> <span class="ident">handle</span> <span class="op">=</span> <span class="ident">Handle</span>::<span class="ident">default</span>();
<span class="kw">let</span> <span class="ident">delay_queue</span>: <span class="ident">DelayQueue</span><span class="op">&lt;</span><span class="ident">u32</span><span class="op">&gt;</span> <span class="op">=</span> <span class="ident">DelayQueue</span>::<span class="ident">with_capacity_and_handle</span>(<span class="number">0</span>, <span class="kw-2">&amp;</span><span class="ident">handle</span>);</pre></div>
</div><h4 id='method.with_capacity' class="method"><code id='with_capacity.v'>pub fn <a href='#method.with_capacity' class='fnname'>with_capacity</a>(capacity: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="struct" href="../../tokio_timer/delay_queue/struct.DelayQueue.html" title="struct tokio_timer::delay_queue::DelayQueue">DelayQueue</a>&lt;T&gt;</code><a class='srclink' href='../../src/tokio_timer/delay_queue.rs.html#272-274' title='goto source code'>[src]</a></h4><div class='docblock'><p>Create a new, empty, <code>DelayQueue</code> with the specified capacity.</p>
<p>The queue will be able to hold at least <code>capacity</code> elements without
reallocating. If <code>capacity</code> is 0, the queue will not allocate for
storage.</p>
<h1 id="examples-2" class="section-header"><a href="#examples-2">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">delay_queue</span> <span class="op">=</span> <span class="ident">DelayQueue</span>::<span class="ident">with_capacity</span>(<span class="number">10</span>);
<span class="comment">// These insertions are done without further allocation</span>
<span class="kw">for</span> <span class="ident">i</span> <span class="kw">in</span> <span class="number">0</span>..<span class="number">10</span> {
<span class="ident">delay_queue</span>.<span class="ident">insert</span>(<span class="ident">i</span>, <span class="ident">Duration</span>::<span class="ident">from_secs</span>(<span class="ident">i</span>));
}
<span class="comment">// This will make the queue allocate additional storage</span>
<span class="ident">delay_queue</span>.<span class="ident">insert</span>(<span class="number">11</span>, <span class="ident">Duration</span>::<span class="ident">from_secs</span>(<span class="number">11</span>));</pre></div>
</div><h4 id='method.insert_at' class="method"><code id='insert_at.v'>pub fn <a href='#method.insert_at' class='fnname'>insert_at</a>(&amp;mut self, value: T, when: <a class="struct" href="https://doc.rust-lang.org/nightly/std/time/struct.Instant.html" title="struct std::time::Instant">Instant</a>) -&gt; <a class="struct" href="../../tokio_timer/delay_queue/struct.Key.html" title="struct tokio_timer::delay_queue::Key">Key</a></code><a class='srclink' href='../../src/tokio_timer/delay_queue.rs.html#324-354' title='goto source code'>[src]</a></h4><div class='docblock'><p>Insert <code>value</code> into the queue set to expire at a specific instant in
time.</p>
<p>This function is identical to <code>insert</code>, but takes an <code>Instant</code> instead
of a <code>Duration</code>.</p>
<p><code>value</code> is stored in the queue until <code>when</code> is reached. At which point,
<code>value</code> will be returned from <a href="#method.poll"><code>poll</code></a>. If <code>when</code> has already been
reached, then <code>value</code> is immediately made available to poll.</p>
<p>The return value represents the insertion and is used at an argument to
<a href="#method.remove"><code>remove</code></a> and <a href="#method.reset"><code>reset</code></a>. Note that <a href="struct.Key.html"><code>Key</code></a> is token and is reused once
<code>value</code> is removed from the queue either by calling <a href="#method.poll"><code>poll</code></a> after
<code>when</code> is reached or by calling <a href="#method.remove"><code>remove</code></a>. At this point, the caller
must take care to not use the returned <a href="struct.Key.html"><code>Key</code></a> again as it may reference
a different item in the queue.</p>
<p>See <a href="#">type</a> level documentation for more details.</p>
<h1 id="panics" class="section-header"><a href="#panics">Panics</a></h1>
<p>This function panics if <code>when</code> is too far in the future.</p>
<h1 id="examples-3" class="section-header"><a href="#examples-3">Examples</a></h1>
<p>Basic usage</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">tokio</span>::<span class="ident">timer</span>::<span class="ident">DelayQueue</span>;
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">time</span>::{<span class="ident">Instant</span>, <span class="ident">Duration</span>};
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">delay_queue</span> <span class="op">=</span> <span class="ident">DelayQueue</span>::<span class="ident">new</span>();
<span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">delay_queue</span>.<span class="ident">insert_at</span>(
<span class="string">&quot;foo&quot;</span>, <span class="ident">Instant</span>::<span class="ident">now</span>() <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">from_secs</span>(<span class="number">5</span>));
<span class="comment">// Remove the entry</span>
<span class="kw">let</span> <span class="ident">item</span> <span class="op">=</span> <span class="ident">delay_queue</span>.<span class="ident">remove</span>(<span class="kw-2">&amp;</span><span class="ident">key</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="kw-2">*</span><span class="ident">item</span>.<span class="ident">get_ref</span>(), <span class="string">&quot;foo&quot;</span>);</pre></div>
</div><h4 id='method.insert' class="method"><code id='insert.v'>pub fn <a href='#method.insert' class='fnname'>insert</a>(&amp;mut self, value: T, timeout: <a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>) -&gt; <a class="struct" href="../../tokio_timer/delay_queue/struct.Key.html" title="struct tokio_timer::delay_queue::Key">Key</a></code><a class='srclink' href='../../src/tokio_timer/delay_queue.rs.html#404-406' title='goto source code'>[src]</a></h4><div class='docblock'><p>Insert <code>value</code> into the queue set to expire after the requested duration
elapses.</p>
<p>This function is identical to <code>insert_at</code>, but takes a <code>Duration</code>
instead of an <code>Instant</code>.</p>
<p><code>value</code> is stored in the queue until <code>when</code> is reached. At which point,
<code>value</code> will be returned from <a href="#method.poll"><code>poll</code></a>. If <code>when</code> has already been
reached, then <code>value</code> is immediately made available to poll.</p>
<p>The return value represents the insertion and is used at an argument to
<a href="#method.remove"><code>remove</code></a> and <a href="#method.reset"><code>reset</code></a>. Note that <a href="struct.Key.html"><code>Key</code></a> is token and is reused once
<code>value</code> is removed from the queue either by calling <a href="#method.poll"><code>poll</code></a> after
<code>when</code> is reached or by calling <a href="#method.remove"><code>remove</code></a>. At this point, the caller
must take care to not use the returned <a href="struct.Key.html"><code>Key</code></a> again as it may reference
a different item in the queue.</p>
<p>See <a href="#">type</a> level documentation for more details.</p>
<h1 id="panics-1" class="section-header"><a href="#panics-1">Panics</a></h1>
<p>This function panics if <code>timeout</code> is greater than the maximum supported
duration.</p>
<h1 id="examples-4" class="section-header"><a href="#examples-4">Examples</a></h1>
<p>Basic usage</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">tokio</span>::<span class="ident">timer</span>::<span class="ident">DelayQueue</span>;
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">time</span>::<span class="ident">Duration</span>;
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">delay_queue</span> <span class="op">=</span> <span class="ident">DelayQueue</span>::<span class="ident">new</span>();
<span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">delay_queue</span>.<span class="ident">insert</span>(<span class="string">&quot;foo&quot;</span>, <span class="ident">Duration</span>::<span class="ident">from_secs</span>(<span class="number">5</span>));
<span class="comment">// Remove the entry</span>
<span class="kw">let</span> <span class="ident">item</span> <span class="op">=</span> <span class="ident">delay_queue</span>.<span class="ident">remove</span>(<span class="kw-2">&amp;</span><span class="ident">key</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="kw-2">*</span><span class="ident">item</span>.<span class="ident">get_ref</span>(), <span class="string">&quot;foo&quot;</span>);</pre></div>
</div><h4 id='method.remove' class="method"><code id='remove.v'>pub fn <a href='#method.remove' class='fnname'>remove</a>(&amp;mut self, key: &amp;<a class="struct" href="../../tokio_timer/delay_queue/struct.Key.html" title="struct tokio_timer::delay_queue::Key">Key</a>) -&gt; <a class="struct" href="../../tokio_timer/delay_queue/struct.Expired.html" title="struct tokio_timer::delay_queue::Expired">Expired</a>&lt;T&gt;</code><a class='srclink' href='../../src/tokio_timer/delay_queue.rs.html#451-468' title='goto source code'>[src]</a></h4><div class='docblock'><p>Remove the item associated with <code>key</code> from the queue.</p>
<p>There must be an item associated with <code>key</code>. The function returns the
removed item as well as the <code>Instant</code> at which it will the delay will
have expired.</p>
<h1 id="panics-2" class="section-header"><a href="#panics-2">Panics</a></h1>
<p>The function panics if <code>key</code> is not contained by the queue.</p>
<h1 id="examples-5" class="section-header"><a href="#examples-5">Examples</a></h1>
<p>Basic usage</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">tokio</span>::<span class="ident">timer</span>::<span class="ident">DelayQueue</span>;
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">time</span>::<span class="ident">Duration</span>;
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">delay_queue</span> <span class="op">=</span> <span class="ident">DelayQueue</span>::<span class="ident">new</span>();
<span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">delay_queue</span>.<span class="ident">insert</span>(<span class="string">&quot;foo&quot;</span>, <span class="ident">Duration</span>::<span class="ident">from_secs</span>(<span class="number">5</span>));
<span class="comment">// Remove the entry</span>
<span class="kw">let</span> <span class="ident">item</span> <span class="op">=</span> <span class="ident">delay_queue</span>.<span class="ident">remove</span>(<span class="kw-2">&amp;</span><span class="ident">key</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="kw-2">*</span><span class="ident">item</span>.<span class="ident">get_ref</span>(), <span class="string">&quot;foo&quot;</span>);</pre></div>
</div><h4 id='method.reset_at' class="method"><code id='reset_at.v'>pub fn <a href='#method.reset_at' class='fnname'>reset_at</a>(&amp;mut self, key: &amp;<a class="struct" href="../../tokio_timer/delay_queue/struct.Key.html" title="struct tokio_timer::delay_queue::Key">Key</a>, when: <a class="struct" href="https://doc.rust-lang.org/nightly/std/time/struct.Instant.html" title="struct std::time::Instant">Instant</a>)</code><a class='srclink' href='../../src/tokio_timer/delay_queue.rs.html#504-517' title='goto source code'>[src]</a></h4><div class='docblock'><p>Sets the delay of the item associated with <code>key</code> to expire at <code>when</code>.</p>
<p>This function is identical to <code>reset</code> but takes an <code>Instant</code> instead of
a <code>Duration</code>.</p>
<p>The item remains in the queue but the delay is set to expire at <code>when</code>.
If <code>when</code> is in the past, then the item is immediately made available to
the caller.</p>
<h1 id="panics-3" class="section-header"><a href="#panics-3">Panics</a></h1>
<p>This function panics if <code>when</code> is too far in the future or if <code>key</code> is
not contained by the queue.</p>
<h1 id="examples-6" class="section-header"><a href="#examples-6">Examples</a></h1>
<p>Basic usage</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">tokio</span>::<span class="ident">timer</span>::<span class="ident">DelayQueue</span>;
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">time</span>::{<span class="ident">Duration</span>, <span class="ident">Instant</span>};
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">delay_queue</span> <span class="op">=</span> <span class="ident">DelayQueue</span>::<span class="ident">new</span>();
<span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">delay_queue</span>.<span class="ident">insert</span>(<span class="string">&quot;foo&quot;</span>, <span class="ident">Duration</span>::<span class="ident">from_secs</span>(<span class="number">5</span>));
<span class="comment">// &quot;foo&quot; is scheduled to be returned in 5 seconds</span>
<span class="ident">delay_queue</span>.<span class="ident">reset_at</span>(<span class="kw-2">&amp;</span><span class="ident">key</span>, <span class="ident">Instant</span>::<span class="ident">now</span>() <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">from_secs</span>(<span class="number">10</span>));
<span class="comment">// &quot;foo&quot;is now scheduled to be returned in 10 seconds</span></pre></div>
</div><h4 id='method.reset' class="method"><code id='reset.v'>pub fn <a href='#method.reset' class='fnname'>reset</a>(&amp;mut self, key: &amp;<a class="struct" href="../../tokio_timer/delay_queue/struct.Key.html" title="struct tokio_timer::delay_queue::Key">Key</a>, timeout: <a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>)</code><a class='srclink' href='../../src/tokio_timer/delay_queue.rs.html#561-563' title='goto source code'>[src]</a></h4><div class='docblock'><p>Sets the delay of the item associated with <code>key</code> to expire after
<code>timeout</code>.</p>
<p>This function is identical to <code>reset_at</code> but takes a <code>Duration</code> instead
of an <code>Instant</code>.</p>
<p>The item remains in the queue but the delay is set to expire after
<code>timeout</code>. If <code>timeout</code> is zero, then the item is immediately made
available to the caller.</p>
<h1 id="panics-4" class="section-header"><a href="#panics-4">Panics</a></h1>
<p>This function panics if <code>timeout</code> is greater than the maximum supported
duration or if <code>key</code> is not contained by the queue.</p>
<h1 id="examples-7" class="section-header"><a href="#examples-7">Examples</a></h1>
<p>Basic usage</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">tokio</span>::<span class="ident">timer</span>::<span class="ident">DelayQueue</span>;
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">time</span>::<span class="ident">Duration</span>;
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">delay_queue</span> <span class="op">=</span> <span class="ident">DelayQueue</span>::<span class="ident">new</span>();
<span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">delay_queue</span>.<span class="ident">insert</span>(<span class="string">&quot;foo&quot;</span>, <span class="ident">Duration</span>::<span class="ident">from_secs</span>(<span class="number">5</span>));
<span class="comment">// &quot;foo&quot; is scheduled to be returned in 5 seconds</span>
<span class="ident">delay_queue</span>.<span class="ident">reset</span>(<span class="kw-2">&amp;</span><span class="ident">key</span>, <span class="ident">Duration</span>::<span class="ident">from_secs</span>(<span class="number">10</span>));
<span class="comment">// &quot;foo&quot;is now scheduled to be returned in 10 seconds</span></pre></div>
</div><h4 id='method.clear' class="method"><code id='clear.v'>pub fn <a href='#method.clear' class='fnname'>clear</a>(&amp;mut self)</code><a class='srclink' href='../../src/tokio_timer/delay_queue.rs.html#592-597' title='goto source code'>[src]</a></h4><div class='docblock'><p>Clears the queue, removing all items.</p>
<p>After calling <code>clear</code>, <a href="#method.poll"><code>poll</code></a> will return <code>Ok(Ready(None))</code>.</p>
<p>Note that this method has no effect on the allocated capacity.</p>
<h1 id="examples-8" class="section-header"><a href="#examples-8">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">tokio</span>::<span class="ident">timer</span>::<span class="ident">DelayQueue</span>;
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">time</span>::<span class="ident">Duration</span>;
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">delay_queue</span> <span class="op">=</span> <span class="ident">DelayQueue</span>::<span class="ident">new</span>();
<span class="ident">delay_queue</span>.<span class="ident">insert</span>(<span class="string">&quot;foo&quot;</span>, <span class="ident">Duration</span>::<span class="ident">from_secs</span>(<span class="number">5</span>));
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">delay_queue</span>.<span class="ident">is_empty</span>());
<span class="ident">delay_queue</span>.<span class="ident">clear</span>();
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">delay_queue</span>.<span class="ident">is_empty</span>());</pre></div>
</div><h4 id='method.capacity' class="method"><code id='capacity.v'>pub fn <a href='#method.capacity' class='fnname'>capacity</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code><a class='srclink' href='../../src/tokio_timer/delay_queue.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the number of elements the queue can hold without reallocating.</p>
<h1 id="examples-9" class="section-header"><a href="#examples-9">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">delay_queue</span>: <span class="ident">DelayQueue</span><span class="op">&lt;</span><span class="ident">i32</span><span class="op">&gt;</span> <span class="op">=</span> <span class="ident">DelayQueue</span>::<span class="ident">with_capacity</span>(<span class="number">10</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">delay_queue</span>.<span class="ident">capacity</span>(), <span class="number">10</span>);</pre></div>
</div><h4 id='method.reserve' class="method"><code id='reserve.v'>pub fn <a href='#method.reserve' class='fnname'>reserve</a>(&amp;mut self, additional: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code><a class='srclink' href='../../src/tokio_timer/delay_queue.rs.html#639-641' title='goto source code'>[src]</a></h4><div class='docblock'><p>Reserve capacity for at least <code>additional</code> more items to be queued
without allocating.</p>
<p><code>reserve</code> does nothing if the queue already has sufficient capacity for
<code>additional</code> more values. If more capacity is required, a new segment of
memory will be allocated and all existing values will be copied into it.
As such, if the queue is already very large, a call to <code>reserve</code> can end
up being expensive.</p>
<p>The queue may reserve more than <code>additional</code> extra space in order to
avoid frequent reallocations.</p>
<h1 id="panics-5" class="section-header"><a href="#panics-5">Panics</a></h1>
<p>Panics if the new capacity exceeds the maximum number of entries the
queue can contain.</p>
<h1 id="examples-10" class="section-header"><a href="#examples-10">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">delay_queue</span> <span class="op">=</span> <span class="ident">DelayQueue</span>::<span class="ident">new</span>();
<span class="ident">delay_queue</span>.<span class="ident">insert</span>(<span class="string">&quot;hello&quot;</span>, <span class="ident">Duration</span>::<span class="ident">from_secs</span>(<span class="number">10</span>));
<span class="ident">delay_queue</span>.<span class="ident">reserve</span>(<span class="number">10</span>);
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">delay_queue</span>.<span class="ident">capacity</span>() <span class="op">&gt;</span><span class="op">=</span> <span class="number">11</span>);</pre></div>
</div><h4 id='method.is_empty' class="method"><code id='is_empty.v'>pub fn <a href='#method.is_empty' class='fnname'>is_empty</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/tokio_timer/delay_queue.rs.html#659-661' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns <code>true</code> if there are no items in the queue.</p>
<p>Note that this function returns <code>false</code> even if all items have not yet
expired and a call to <code>poll</code> will return <code>NotReady</code>.</p>
<h1 id="examples-11" class="section-header"><a href="#examples-11">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">time</span>::<span class="ident">Duration</span>;
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">delay_queue</span> <span class="op">=</span> <span class="ident">DelayQueue</span>::<span class="ident">new</span>();
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">delay_queue</span>.<span class="ident">is_empty</span>());
<span class="ident">delay_queue</span>.<span class="ident">insert</span>(<span class="string">&quot;hello&quot;</span>, <span class="ident">Duration</span>::<span class="ident">from_secs</span>(<span class="number">5</span>));
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">delay_queue</span>.<span class="ident">is_empty</span>());</pre></div>
</div></div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-Debug' class='impl'><code class='in-band'>impl&lt;T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../tokio_timer/delay_queue/struct.DelayQueue.html" title="struct tokio_timer::delay_queue::DelayQueue">DelayQueue</a>&lt;T&gt;</code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../src/tokio_timer/delay_queue.rs.html#128' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../src/tokio_timer/delay_queue.rs.html#128' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id='impl-Stream' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a> for <a class="struct" href="../../tokio_timer/delay_queue/struct.DelayQueue.html" title="struct tokio_timer::delay_queue::DelayQueue">DelayQueue</a>&lt;T&gt;</code><a href='#impl-Stream' class='anchor'></a><a class='srclink' href='../../src/tokio_timer/delay_queue.rs.html#712-731' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Item' class="type"><code id='Item.t'>type <a href='../../futures/stream/trait.Stream.html#associatedtype.Item' class="type">Item</a> = <a class="struct" href="../../tokio_timer/delay_queue/struct.Expired.html" title="struct tokio_timer::delay_queue::Expired">Expired</a>&lt;T&gt;</code></h4><div class='docblock'><p>The type of item this stream will yield on success.</p>
</div><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='../../futures/stream/trait.Stream.html#associatedtype.Error' class="type">Error</a> = <a class="struct" href="../../tokio_timer/struct.Error.html" title="struct tokio_timer::Error">Error</a></code></h4><div class='docblock'><p>The type of error this stream may generate.</p>
</div><h4 id='method.poll' class="method hidden"><code id='poll.v'>fn <a href='../../futures/stream/trait.Stream.html#tymethod.poll' class='fnname'>poll</a>(&amp;mut self) -&gt; <a class="type" href="../../futures/poll/type.Poll.html" title="type futures::poll::Poll">Poll</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>&gt;, <a class="struct" href="../../tokio_timer/struct.Error.html" title="struct tokio_timer::Error">Error</a>&gt;</code><a class='srclink' href='../../src/tokio_timer/delay_queue.rs.html#716-730' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Attempt to pull out the next value of this stream, returning <code>None</code> if the stream is finished. <a href="../../futures/stream/trait.Stream.html#tymethod.poll">Read more</a></p>
</div><h4 id='method.wait' class="method hidden"><code id='wait.v'>fn <a href='../../futures/stream/trait.Stream.html#method.wait' class='fnname'>wait</a>(self) -&gt; <a class="struct" href="../../futures/stream/wait/struct.Wait.html" title="struct futures::stream::wait::Wait">Wait</a>&lt;Self&gt;</code><a class='srclink' href='../../src/futures/stream/mod.rs.html#245-249' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates an iterator which blocks the current thread until each item of this stream is resolved. <a href="../../futures/stream/trait.Stream.html#method.wait">Read more</a></p>
</div><h4 id='method.into_future' class="method hidden"><code id='into_future.v'>fn <a href='../../futures/stream/trait.Stream.html#method.into_future' class='fnname'>into_future</a>(self) -&gt; <a class="struct" href="../../futures/stream/future/struct.StreamFuture.html" title="struct futures::stream::future::StreamFuture">StreamFuture</a>&lt;Self&gt;</code><a class='srclink' href='../../src/futures/stream/mod.rs.html#292-296' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Converts this stream into a <code>Future</code>. <a href="../../futures/stream/trait.Stream.html#method.into_future">Read more</a></p>
</div><h4 id='method.map' class="method hidden"><code id='map.v'>fn <a href='../../futures/stream/trait.Stream.html#method.map' class='fnname'>map</a>&lt;U, F&gt;(self, f: F) -&gt; <a class="struct" href="../../futures/stream/map/struct.Map.html" title="struct futures::stream::map::Map">Map</a>&lt;Self, F&gt; <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.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>) -&gt; U,&nbsp;</span></code><a class='srclink' href='../../src/futures/stream/mod.rs.html#317-322' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Converts a stream of type <code>T</code> to a stream of type <code>U</code>. <a href="../../futures/stream/trait.Stream.html#method.map">Read more</a></p>
</div><h4 id='method.map_err' class="method hidden"><code id='map_err.v'>fn <a href='../../futures/stream/trait.Stream.html#method.map_err' class='fnname'>map_err</a>&lt;U, F&gt;(self, f: F) -&gt; <a class="struct" href="../../futures/stream/map_err/struct.MapErr.html" title="struct futures::stream::map_err::MapErr">MapErr</a>&lt;Self, F&gt; <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.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Error" title="type futures::stream::Stream::Error">Error</a>) -&gt; U,&nbsp;</span></code><a class='srclink' href='../../src/futures/stream/mod.rs.html#343-348' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Converts a stream of error type <code>T</code> to a stream of error type <code>U</code>. <a href="../../futures/stream/trait.Stream.html#method.map_err">Read more</a></p>
</div><h4 id='method.filter' class="method hidden"><code id='filter.v'>fn <a href='../../futures/stream/trait.Stream.html#method.filter' class='fnname'>filter</a>&lt;F&gt;(self, f: F) -&gt; <a class="struct" href="../../futures/stream/filter/struct.Filter.html" title="struct futures::stream::filter::Filter">Filter</a>&lt;Self, F&gt; <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.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&amp;Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,&nbsp;</span></code><a class='srclink' href='../../src/futures/stream/mod.rs.html#373-378' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Filters the values produced by this stream according to the provided predicate. <a href="../../futures/stream/trait.Stream.html#method.filter">Read more</a></p>
</div><h4 id='method.filter_map' class="method hidden"><code id='filter_map.v'>fn <a href='../../futures/stream/trait.Stream.html#method.filter_map' class='fnname'>filter_map</a>&lt;F, B&gt;(self, f: F) -&gt; <a class="struct" href="../../futures/stream/filter_map/struct.FilterMap.html" title="struct futures::stream::filter_map::FilterMap">FilterMap</a>&lt;Self, F&gt; <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.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;B&gt;,&nbsp;</span></code><a class='srclink' href='../../src/futures/stream/mod.rs.html#409-414' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Filters the values produced by this stream while simultaneously mapping them to a different type. <a href="../../futures/stream/trait.Stream.html#method.filter_map">Read more</a></p>
</div><h4 id='method.then' class="method hidden"><code id='then.v'>fn <a href='../../futures/stream/trait.Stream.html#method.then' class='fnname'>then</a>&lt;F, U&gt;(self, f: F) -&gt; <a class="struct" href="../../futures/stream/then/struct.Then.html" title="struct futures::stream::then::Then">Then</a>&lt;Self, F, U&gt; <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.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<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/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>, Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Error" title="type futures::stream::Stream::Error">Error</a>&gt;) -&gt; U,<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="../../futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>,&nbsp;</span></code><a class='srclink' href='../../src/futures/stream/mod.rs.html#448-454' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Chain on a computation for when a value is ready, passing the resulting item to the provided closure <code>f</code>. <a href="../../futures/stream/trait.Stream.html#method.then">Read more</a></p>
</div><h4 id='method.and_then' class="method hidden"><code id='and_then.v'>fn <a href='../../futures/stream/trait.Stream.html#method.and_then' class='fnname'>and_then</a>&lt;F, U&gt;(self, f: F) -&gt; <a class="struct" href="../../futures/stream/and_then/struct.AndThen.html" title="struct futures::stream::and_then::AndThen">AndThen</a>&lt;Self, F, U&gt; <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.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>) -&gt; U,<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="../../futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>&lt;Error = Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Error" title="type futures::stream::Stream::Error">Error</a>&gt;,&nbsp;</span></code><a class='srclink' href='../../src/futures/stream/mod.rs.html#495-501' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Chain on a computation for when a value is ready, passing the successful results to the provided closure <code>f</code>. <a href="../../futures/stream/trait.Stream.html#method.and_then">Read more</a></p>
</div><h4 id='method.or_else' class="method hidden"><code id='or_else.v'>fn <a href='../../futures/stream/trait.Stream.html#method.or_else' class='fnname'>or_else</a>&lt;F, U&gt;(self, f: F) -&gt; <a class="struct" href="../../futures/stream/or_else/struct.OrElse.html" title="struct futures::stream::or_else::OrElse">OrElse</a>&lt;Self, F, U&gt; <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.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Error" title="type futures::stream::Stream::Error">Error</a>) -&gt; U,<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="../../futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>&lt;Item = Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>&gt;,&nbsp;</span></code><a class='srclink' href='../../src/futures/stream/mod.rs.html#522-528' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Chain on a computation for when an error happens, passing the erroneous result to the provided closure <code>f</code>. <a href="../../futures/stream/trait.Stream.html#method.or_else">Read more</a></p>
</div><h4 id='method.collect' class="method hidden"><code id='collect.v'>fn <a href='../../futures/stream/trait.Stream.html#method.collect' class='fnname'>collect</a>(self) -&gt; <a class="struct" href="../../futures/stream/collect/struct.Collect.html" title="struct futures::stream::collect::Collect">Collect</a>&lt;Self&gt;</code><a class='srclink' href='../../src/futures/stream/mod.rs.html#563-567' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Collect all of the values of this stream into a vector, returning a future representing the result of that computation. <a href="../../futures/stream/trait.Stream.html#method.collect">Read more</a></p>
</div><h4 id='method.concat2' class="method hidden"><code id='concat2.v'>fn <a href='../../futures/stream/trait.Stream.html#method.concat2' class='fnname'>concat2</a>(self) -&gt; <a class="struct" href="../../futures/stream/concat/struct.Concat2.html" title="struct futures::stream::concat::Concat2">Concat2</a>&lt;Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.Extend.html" title="trait core::iter::traits::collect::Extend">Extend</a>&lt;&lt;Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a>,&nbsp;</span></code><a class='srclink' href='../../src/futures/stream/mod.rs.html#599-604' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Concatenate all results of a stream into a single extendable destination, returning a future representing the end result. <a href="../../futures/stream/trait.Stream.html#method.concat2">Read more</a></p>
</div><h4 id='method.concat' class="method hidden"><code id='concat.v'>fn <a href='../../futures/stream/trait.Stream.html#method.concat' class='fnname'>concat</a>(self) -&gt; <a class="struct" href="../../futures/stream/concat/struct.Concat.html" title="struct futures::stream::concat::Concat">Concat</a>&lt;Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.Extend.html" title="trait core::iter::traits::collect::Extend">Extend</a>&lt;&lt;Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,&nbsp;</span></code><a class='srclink' href='../../src/futures/stream/mod.rs.html#639-644' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab deprecated'>Deprecated since 0.1.14: <p>please use <code>Stream::concat2</code> instead</p>
</div></div><div class='docblock hidden'><p>Concatenate all results of a stream into a single extendable destination, returning a future representing the end result. <a href="../../futures/stream/trait.Stream.html#method.concat">Read more</a></p>
</div><h4 id='method.fold' class="method hidden"><code id='fold.v'>fn <a href='../../futures/stream/trait.Stream.html#method.fold' class='fnname'>fold</a>&lt;F, T, Fut&gt;(self, init: T, f: F) -&gt; <a class="struct" href="../../futures/stream/fold/struct.Fold.html" title="struct futures::stream::fold::Fold">Fold</a>&lt;Self, F, Fut, T&gt; <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.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(T, Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>) -&gt; Fut,<br>&nbsp;&nbsp;&nbsp;&nbsp;Fut: <a class="trait" href="../../futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>&lt;Item = T&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Error" title="type futures::stream::Stream::Error">Error</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;&lt;Fut as <a class="trait" href="../../futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>&gt;::<a class="type" href="../../futures/future/trait.IntoFuture.html#associatedtype.Error" title="type futures::future::IntoFuture::Error">Error</a>&gt;,&nbsp;</span></code><a class='srclink' href='../../src/futures/stream/mod.rs.html#669-676' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Execute an accumulating computation over a stream, collecting all the values into one final result. <a href="../../futures/stream/trait.Stream.html#method.fold">Read more</a></p>
</div><h4 id='method.flatten' class="method hidden"><code id='flatten.v'>fn <a href='../../futures/stream/trait.Stream.html#method.flatten' class='fnname'>flatten</a>(self) -&gt; <a class="struct" href="../../futures/stream/flatten/struct.Flatten.html" title="struct futures::stream::flatten::Flatten">Flatten</a>&lt;Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a> as <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>&gt;::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Error" title="type futures::stream::Stream::Error">Error</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Error" title="type futures::stream::Stream::Error">Error</a>&gt;,&nbsp;</span></code><a class='srclink' href='../../src/futures/stream/mod.rs.html#711-717' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Flattens a stream of streams into just one continuous stream. <a href="../../futures/stream/trait.Stream.html#method.flatten">Read more</a></p>
</div><h4 id='method.skip_while' class="method hidden"><code id='skip_while.v'>fn <a href='../../futures/stream/trait.Stream.html#method.skip_while' class='fnname'>skip_while</a>&lt;P, R&gt;(self, pred: P) -&gt; <a class="struct" href="../../futures/stream/skip_while/struct.SkipWhile.html" title="struct futures::stream::skip_while::SkipWhile">SkipWhile</a>&lt;Self, P, R&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&amp;Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>) -&gt; R,<br>&nbsp;&nbsp;&nbsp;&nbsp;R: <a class="trait" href="../../futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>&lt;Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>, Error = Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Error" title="type futures::stream::Stream::Error">Error</a>&gt;,&nbsp;</span></code><a class='srclink' href='../../src/futures/stream/mod.rs.html#726-732' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Skip elements on this stream while the predicate provided resolves to <code>true</code>. <a href="../../futures/stream/trait.Stream.html#method.skip_while">Read more</a></p>
</div><h4 id='method.take_while' class="method hidden"><code id='take_while.v'>fn <a href='../../futures/stream/trait.Stream.html#method.take_while' class='fnname'>take_while</a>&lt;P, R&gt;(self, pred: P) -&gt; <a class="struct" href="../../futures/stream/take_while/struct.TakeWhile.html" title="struct futures::stream::take_while::TakeWhile">TakeWhile</a>&lt;Self, P, R&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&amp;Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>) -&gt; R,<br>&nbsp;&nbsp;&nbsp;&nbsp;R: <a class="trait" href="../../futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>&lt;Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>, Error = Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Error" title="type futures::stream::Stream::Error">Error</a>&gt;,&nbsp;</span></code><a class='srclink' href='../../src/futures/stream/mod.rs.html#740-746' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Take elements from this stream while the predicate provided resolves to <code>true</code>. <a href="../../futures/stream/trait.Stream.html#method.take_while">Read more</a></p>
</div><h4 id='method.for_each' class="method hidden"><code id='for_each.v'>fn <a href='../../futures/stream/trait.Stream.html#method.for_each' class='fnname'>for_each</a>&lt;F, U&gt;(self, f: F) -&gt; <a class="struct" href="../../futures/stream/for_each/struct.ForEach.html" title="struct futures::stream::for_each::ForEach">ForEach</a>&lt;Self, F, U&gt; <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.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>) -&gt; U,<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="../../futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>&lt;Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, Error = Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Error" title="type futures::stream::Stream::Error">Error</a>&gt;,&nbsp;</span></code><a class='srclink' href='../../src/futures/stream/mod.rs.html#762-768' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Runs this stream to completion, executing the provided closure for each element on the stream. <a href="../../futures/stream/trait.Stream.html#method.for_each">Read more</a></p>
</div><h4 id='method.from_err' class="method hidden"><code id='from_err.v'>fn <a href='../../futures/stream/trait.Stream.html#method.from_err' class='fnname'>from_err</a>&lt;E&gt;(self) -&gt; <a class="struct" href="../../futures/stream/from_err/struct.FromErr.html" title="struct futures::stream::from_err::FromErr">FromErr</a>&lt;Self, E&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Error" title="type futures::stream::Stream::Error">Error</a>&gt;,&nbsp;</span></code><a class='srclink' href='../../src/futures/stream/mod.rs.html#781-785' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Map this stream's error to any error implementing <code>From</code> for this stream's <code>Error</code>, returning a new stream. <a href="../../futures/stream/trait.Stream.html#method.from_err">Read more</a></p>
</div><h4 id='method.take' class="method hidden"><code id='take.v'>fn <a href='../../futures/stream/trait.Stream.html#method.take' class='fnname'>take</a>(self, amt: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -&gt; <a class="struct" href="../../futures/stream/take/struct.Take.html" title="struct futures::stream::take::Take">Take</a>&lt;Self&gt;</code><a class='srclink' href='../../src/futures/stream/mod.rs.html#797-801' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates a new stream of at most <code>amt</code> items of the underlying stream. <a href="../../futures/stream/trait.Stream.html#method.take">Read more</a></p>
</div><h4 id='method.skip' class="method hidden"><code id='skip.v'>fn <a href='../../futures/stream/trait.Stream.html#method.skip' class='fnname'>skip</a>(self, amt: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -&gt; <a class="struct" href="../../futures/stream/skip/struct.Skip.html" title="struct futures::stream::skip::Skip">Skip</a>&lt;Self&gt;</code><a class='srclink' href='../../src/futures/stream/mod.rs.html#812-816' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates a new stream which skips <code>amt</code> items of the underlying stream. <a href="../../futures/stream/trait.Stream.html#method.skip">Read more</a></p>
</div><h4 id='method.fuse' class="method hidden"><code id='fuse.v'>fn <a href='../../futures/stream/trait.Stream.html#method.fuse' class='fnname'>fuse</a>(self) -&gt; <a class="struct" href="../../futures/stream/fuse/struct.Fuse.html" title="struct futures::stream::fuse::Fuse">Fuse</a>&lt;Self&gt;</code><a class='srclink' href='../../src/futures/stream/mod.rs.html#833-837' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Fuse a stream such that <code>poll</code> will never again be called once it has finished. <a href="../../futures/stream/trait.Stream.html#method.fuse">Read more</a></p>
</div><h4 id='method.by_ref' class="method hidden"><code id='by_ref.v'>fn <a href='../../futures/stream/trait.Stream.html#method.by_ref' class='fnname'>by_ref</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self</code><a class='srclink' href='../../src/futures/stream/mod.rs.html#858-862' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Borrows a stream, rather than consuming it. <a href="../../futures/stream/trait.Stream.html#method.by_ref">Read more</a></p>
</div><h4 id='method.catch_unwind' class="method hidden"><code id='catch_unwind.v'>fn <a href='../../futures/stream/trait.Stream.html#method.catch_unwind' class='fnname'>catch_unwind</a>(self) -&gt; <a class="struct" href="../../futures/stream/catch_unwind/struct.CatchUnwind.html" title="struct futures::stream::catch_unwind::CatchUnwind">CatchUnwind</a>&lt;Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a>,&nbsp;</span></code><a class='srclink' href='../../src/futures/stream/mod.rs.html#898-902' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Catches unwinding panics while polling the stream. <a href="../../futures/stream/trait.Stream.html#method.catch_unwind">Read more</a></p>
</div><h4 id='method.buffered' class="method hidden"><code id='buffered.v'>fn <a href='../../futures/stream/trait.Stream.html#method.buffered' class='fnname'>buffered</a>(self, amt: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="struct" href="../../futures/stream/buffered/struct.Buffered.html" title="struct futures::stream::buffered::Buffered">Buffered</a>&lt;Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>: <a class="trait" href="../../futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a> as <a class="trait" href="../../futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>&gt;::<a class="type" href="../../futures/future/trait.IntoFuture.html#associatedtype.Error" title="type futures::future::IntoFuture::Error">Error</a> == Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Error" title="type futures::stream::Stream::Error">Error</a>,&nbsp;</span></code><a class='srclink' href='../../src/futures/stream/mod.rs.html#918-923' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>An adaptor for creating a buffered list of pending futures. <a href="../../futures/stream/trait.Stream.html#method.buffered">Read more</a></p>
</div><h4 id='method.buffer_unordered' class="method hidden"><code id='buffer_unordered.v'>fn <a href='../../futures/stream/trait.Stream.html#method.buffer_unordered' class='fnname'>buffer_unordered</a>(self, amt: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="struct" href="../../futures/stream/buffer_unordered/struct.BufferUnordered.html" title="struct futures::stream::buffer_unordered::BufferUnordered">BufferUnordered</a>&lt;Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>: <a class="trait" href="../../futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a> as <a class="trait" href="../../futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>&gt;::<a class="type" href="../../futures/future/trait.IntoFuture.html#associatedtype.Error" title="type futures::future::IntoFuture::Error">Error</a> == Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Error" title="type futures::stream::Stream::Error">Error</a>,&nbsp;</span></code><a class='srclink' href='../../src/futures/stream/mod.rs.html#939-944' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>An adaptor for creating a buffered list of pending futures (unordered). <a href="../../futures/stream/trait.Stream.html#method.buffer_unordered">Read more</a></p>
</div><h4 id='method.merge' class="method hidden"><code id='merge.v'>fn <a href='../../futures/stream/trait.Stream.html#method.merge' class='fnname'>merge</a>&lt;S&gt;(self, other: S) -&gt; <a class="struct" href="../../futures/stream/merge/struct.Merge.html" title="struct futures::stream::merge::Merge">Merge</a>&lt;Self, S&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>&lt;Error = Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Error" title="type futures::stream::Stream::Error">Error</a>&gt;,&nbsp;</span></code><a class='srclink' href='../../src/futures/stream/mod.rs.html#953-958' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab deprecated'>Deprecated: <p>functionality provided by <code>select</code> now</p>
</div></div><div class='docblock hidden'><p>An adapter for merging the output of two streams. <a href="../../futures/stream/trait.Stream.html#method.merge">Read more</a></p>
</div><h4 id='method.zip' class="method hidden"><code id='zip.v'>fn <a href='../../futures/stream/trait.Stream.html#method.zip' class='fnname'>zip</a>&lt;S&gt;(self, other: S) -&gt; <a class="struct" href="../../futures/stream/zip/struct.Zip.html" title="struct futures::stream::zip::Zip">Zip</a>&lt;Self, S&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>&lt;Error = Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Error" title="type futures::stream::Stream::Error">Error</a>&gt;,&nbsp;</span></code><a class='srclink' href='../../src/futures/stream/mod.rs.html#965-970' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>An adapter for zipping two streams together. <a href="../../futures/stream/trait.Stream.html#method.zip">Read more</a></p>
</div><h4 id='method.chain' class="method hidden"><code id='chain.v'>fn <a href='../../futures/stream/trait.Stream.html#method.chain' class='fnname'>chain</a>&lt;S&gt;(self, other: S) -&gt; <a class="struct" href="../../futures/stream/chain/struct.Chain.html" title="struct futures::stream::chain::Chain">Chain</a>&lt;Self, S&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>&lt;Item = Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>, Error = Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Error" title="type futures::stream::Stream::Error">Error</a>&gt;,&nbsp;</span></code><a class='srclink' href='../../src/futures/stream/mod.rs.html#991-996' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Adapter for chaining two stream. <a href="../../futures/stream/trait.Stream.html#method.chain">Read more</a></p>
</div><h4 id='method.peekable' class="method hidden"><code id='peekable.v'>fn <a href='../../futures/stream/trait.Stream.html#method.peekable' class='fnname'>peekable</a>(self) -&gt; <a class="struct" href="../../futures/stream/peek/struct.Peekable.html" title="struct futures::stream::peek::Peekable">Peekable</a>&lt;Self&gt;</code><a class='srclink' href='../../src/futures/stream/mod.rs.html#1001-1005' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates a new stream which exposes a <code>peek</code> method. <a href="../../futures/stream/trait.Stream.html#method.peekable">Read more</a></p>
</div><h4 id='method.chunks' class="method hidden"><code id='chunks.v'>fn <a href='../../futures/stream/trait.Stream.html#method.chunks' class='fnname'>chunks</a>(self, capacity: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="struct" href="../../futures/stream/chunks/struct.Chunks.html" title="struct futures::stream::chunks::Chunks">Chunks</a>&lt;Self&gt;</code><a class='srclink' href='../../src/futures/stream/mod.rs.html#1028-1032' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>An adaptor for chunking up items of the stream inside a vector. <a href="../../futures/stream/trait.Stream.html#method.chunks">Read more</a></p>
</div><h4 id='method.select' class="method hidden"><code id='select.v'>fn <a href='../../futures/stream/trait.Stream.html#method.select' class='fnname'>select</a>&lt;S&gt;(self, other: S) -&gt; <a class="struct" href="../../futures/stream/select/struct.Select.html" title="struct futures::stream::select::Select">Select</a>&lt;Self, S&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>&lt;Item = Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>, Error = Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Error" title="type futures::stream::Stream::Error">Error</a>&gt;,&nbsp;</span></code><a class='srclink' href='../../src/futures/stream/mod.rs.html#1045-1050' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates a stream that selects the next element from either this stream or the provided one, whichever is ready first. <a href="../../futures/stream/trait.Stream.html#method.select">Read more</a></p>
</div><h4 id='method.forward' class="method hidden"><code id='forward.v'>fn <a href='../../futures/stream/trait.Stream.html#method.forward' class='fnname'>forward</a>&lt;S&gt;(self, sink: S) -&gt; <a class="struct" href="../../futures/stream/forward/struct.Forward.html" title="struct futures::stream::forward::Forward">Forward</a>&lt;Self, S&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="../../futures/sink/trait.Sink.html" title="trait futures::sink::Sink">Sink</a>&lt;SinkItem = Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Error" title="type futures::stream::Stream::Error">Error</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;&lt;S as <a class="trait" href="../../futures/sink/trait.Sink.html" title="trait futures::sink::Sink">Sink</a>&gt;::<a class="type" href="../../futures/sink/trait.Sink.html#associatedtype.SinkError" title="type futures::sink::Sink::SinkError">SinkError</a>&gt;,&nbsp;</span></code><a class='srclink' href='../../src/futures/stream/mod.rs.html#1066-1072' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>A future that completes after the given stream has been fully processed into the sink, including flushing. <a href="../../futures/stream/trait.Stream.html#method.forward">Read more</a></p>
</div><h4 id='method.split' class="method hidden"><code id='split.v'>fn <a href='../../futures/stream/trait.Stream.html#method.split' class='fnname'>split</a>(self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="struct" href="../../futures/stream/split/struct.SplitSink.html" title="struct futures::stream::split::SplitSink">SplitSink</a>&lt;Self&gt;, <a class="struct" href="../../futures/stream/split/struct.SplitStream.html" title="struct futures::stream::split::SplitStream">SplitStream</a>&lt;Self&gt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="../../futures/sink/trait.Sink.html" title="trait futures::sink::Sink">Sink</a>,&nbsp;</span></code><a class='srclink' href='../../src/futures/stream/mod.rs.html#1084-1088' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Splits this <code>Stream + Sink</code> object into separate <code>Stream</code> and <code>Sink</code> objects. <a href="../../futures/stream/trait.Stream.html#method.split">Read more</a></p>
</div><h4 id='method.inspect' class="method hidden"><code id='inspect.v'>fn <a href='../../futures/stream/trait.Stream.html#method.inspect' class='fnname'>inspect</a>&lt;F&gt;(self, f: F) -&gt; <a class="struct" href="../../futures/stream/inspect/struct.Inspect.html" title="struct futures::stream::inspect::Inspect">Inspect</a>&lt;Self, F&gt; <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.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&amp;Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>),&nbsp;</span></code><a class='srclink' href='../../src/futures/stream/mod.rs.html#1095-1100' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Do something with each item of this stream, afterwards passing it on. <a href="../../futures/stream/trait.Stream.html#method.inspect">Read more</a></p>
</div><h4 id='method.inspect_err' class="method hidden"><code id='inspect_err.v'>fn <a href='../../futures/stream/trait.Stream.html#method.inspect_err' class='fnname'>inspect_err</a>&lt;F&gt;(self, f: F) -&gt; <a class="struct" href="../../futures/stream/inspect_err/struct.InspectErr.html" title="struct futures::stream::inspect_err::InspectErr">InspectErr</a>&lt;Self, F&gt; <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.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&amp;Self::<a class="type" href="../../futures/stream/trait.Stream.html#associatedtype.Error" title="type futures::stream::Stream::Error">Error</a>),&nbsp;</span></code><a class='srclink' href='../../src/futures/stream/mod.rs.html#1107-1112' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Do something with the error of this stream, afterwards passing it on. <a href="../../futures/stream/trait.Stream.html#method.inspect_err">Read more</a></p>
</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl&lt;T&gt; !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../tokio_timer/delay_queue/struct.DelayQueue.html" title="struct tokio_timer::delay_queue::DelayQueue">DelayQueue</a>&lt;T&gt;</code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../tokio_timer/delay_queue/struct.DelayQueue.html" title="struct tokio_timer::delay_queue::DelayQueue">DelayQueue</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,&nbsp;</span></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../tokio_timer/delay_queue/struct.DelayQueue.html" title="struct tokio_timer::delay_queue::DelayQueue">DelayQueue</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,&nbsp;</span></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../tokio_timer/delay_queue/struct.DelayQueue.html" title="struct tokio_timer::delay_queue::DelayQueue">DelayQueue</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <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 href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl&lt;T&gt; !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../tokio_timer/delay_queue/struct.DelayQueue.html" title="struct tokio_timer::delay_queue::DelayQueue">DelayQueue</a>&lt;T&gt;</code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<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 href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<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 href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<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 href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#564-568' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -&gt; T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-567' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <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; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#553-560' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -&gt; U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#557-559' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#601-610' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#607-609' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#587-596' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-2' class="type"><code id='Error.t-2'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#593-595' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "tokio_timer";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>