mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-02-23 15:49:49 +01:00
127 lines
66 KiB
HTML
127 lines
66 KiB
HTML
<!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 `SinkExt` trait in crate `futures`."><meta name="keywords" content="rust, rustlang, rust-lang, SinkExt"><title>futures::sink::SinkExt - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
|
||
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
|
||
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../futures/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Trait SinkExt</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#provided-methods">Provided Methods</a><div class="sidebar-links"><a href="#method.close">close</a><a href="#method.fanout">fanout</a><a href="#method.feed">feed</a><a href="#method.flush">flush</a><a href="#method.send">send</a><a href="#method.send_all">send_all</a><a href="#method.with">with</a><a href="#method.with_flat_map">with_flat_map</a><a href="#method.buffer">buffer</a><a href="#method.sink_map_err">sink_map_err</a><a href="#method.sink_err_into">sink_err_into</a><a href="#method.left_sink">left_sink</a><a href="#method.right_sink">right_sink</a><a href="#method.poll_ready_unpin">poll_ready_unpin</a><a href="#method.start_send_unpin">start_send_unpin</a><a href="#method.poll_flush_unpin">poll_flush_unpin</a><a href="#method.poll_close_unpin">poll_close_unpin</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class="location"><a href="../index.html">futures</a>::<wbr><a href="index.html">sink</a></p><div id="sidebar-vars" data-name="SinkExt" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Trait <a href="../index.html">futures</a>::<wbr><a href="index.html">sink</a>::<wbr><a class="trait" href="">SinkExt</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../src/futures_util/sink/mod.rs.html#65-334" title="goto source code">[src]</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust trait">pub trait SinkExt<Item>: <a class="trait" href="../../futures/sink/trait.Sink.html" title="trait futures::sink::Sink">Sink</a><Item> {
|
||
pub fn <a href="#method.with" class="fnname">with</a><U, Fut, F, E>(self, f: F) -> <a class="struct" href="../../futures/sink/struct.With.html" title="struct futures::sink::With">With</a><Self, Item, U, Fut, F><br> <span class="where">where<br> E: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Self::<a class="type" href="../../futures/sink/trait.Sink.html#associatedtype.Error" title="type futures::sink::Sink::Error">Error</a>>,<br> 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>(U) -> Fut,<br> Fut: <a class="trait" href="../../futures/future/trait.Future.html" title="trait futures::future::Future">Future</a><Output = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Item, E>></span>,
|
||
{ ... }
|
||
<div class="item-spacer"></div> pub fn <a href="#method.with_flat_map" class="fnname">with_flat_map</a><U, St, F>(<br> self, <br> f: F<br> ) -> <a class="struct" href="../../futures/sink/struct.WithFlatMap.html" title="struct futures::sink::WithFlatMap">WithFlatMap</a><Self, Item, U, St, F><br> <span class="where">where<br> 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>(U) -> St,<br> St: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a><Item = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Item, Self::<a class="type" href="../../futures/sink/trait.Sink.html#associatedtype.Error" title="type futures::sink::Sink::Error">Error</a>>></span>,
|
||
{ ... }
|
||
<div class="item-spacer"></div> pub fn <a href="#method.sink_map_err" class="fnname">sink_map_err</a><E, F>(self, f: F) -> <a class="struct" href="../../futures/sink/struct.SinkMapErr.html" title="struct futures::sink::SinkMapErr">SinkMapErr</a><Self, F><br> <span class="where">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(Self::<a class="type" href="../../futures/sink/trait.Sink.html#associatedtype.Error" title="type futures::sink::Sink::Error">Error</a>) -> E</span>,
|
||
{ ... }
|
||
<div class="item-spacer"></div> pub fn <a href="#method.sink_err_into" class="fnname">sink_err_into</a><E>(self) -> <a class="struct" href="../../futures/sink/struct.SinkErrInto.html" title="struct futures::sink::SinkErrInto">SinkErrInto</a><Self, Item, E><br> <span class="where">where<br> Self::<a class="type" href="../../futures/sink/trait.Sink.html#associatedtype.Error" title="type futures::sink::Sink::Error">Error</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><E></span>,
|
||
{ ... }
|
||
<div class="item-spacer"></div> pub fn <a href="#method.buffer" class="fnname">buffer</a>(self, capacity: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="struct" href="../../futures/sink/struct.Buffer.html" title="struct futures::sink::Buffer">Buffer</a><Self, Item> { ... }
|
||
<div class="item-spacer"></div> pub fn <a href="#method.close" class="fnname">close</a>(&mut self) -> <a class="struct" href="../../futures/sink/struct.Close.html" title="struct futures::sink::Close">Close</a><'_, Self, Item><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../../futures/sink/struct.Close.html" title="struct futures::sink::Close">Close</a><'_, Si, Item></h3><code class="content"><span class="where fmt-newline">impl<'_, Si, Item> <a class="trait" href="../../futures/future/trait.Future.html" title="trait futures::future::Future">Future</a> for <a class="struct" href="../../futures/sink/struct.Close.html" title="struct futures::sink::Close">Close</a><'_, Si, Item> <span class="where fmt-newline">where<br> Si: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> + <a class="trait" href="../../futures/sink/trait.Sink.html" title="trait futures::sink::Sink">Sink</a><Item> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></span><span class="where fmt-newline"> type <a href="../../futures/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <Si as <a class="trait" href="../../futures/sink/trait.Sink.html" title="trait futures::sink::Sink">Sink</a><Item>>::<a class="type" href="../../futures/sink/trait.Sink.html#associatedtype.Error" title="type futures::sink::Sink::Error">Error</a>>;</span></code></span></div></span></span><br> <span class="where">where<br> Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a></span>,
|
||
{ ... }
|
||
<div class="item-spacer"></div> pub fn <a href="#method.fanout" class="fnname">fanout</a><Si>(self, other: Si) -> <a class="struct" href="../../futures/sink/struct.Fanout.html" title="struct futures::sink::Fanout">Fanout</a><Self, Si><br> <span class="where">where<br> Item: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,<br> Si: <a class="trait" href="../../futures/sink/trait.Sink.html" title="trait futures::sink::Sink">Sink</a><Item, Error = Self::<a class="type" href="../../futures/sink/trait.Sink.html#associatedtype.Error" title="type futures::sink::Sink::Error">Error</a>></span>,
|
||
{ ... }
|
||
<div class="item-spacer"></div> pub fn <a href="#method.flush" class="fnname">flush</a>(&mut self) -> <a class="struct" href="../../futures/sink/struct.Flush.html" title="struct futures::sink::Flush">Flush</a><'_, Self, Item><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../../futures/sink/struct.Flush.html" title="struct futures::sink::Flush">Flush</a><'_, Si, Item></h3><code class="content"><span class="where fmt-newline">impl<'_, Si, Item> <a class="trait" href="../../futures/future/trait.Future.html" title="trait futures::future::Future">Future</a> for <a class="struct" href="../../futures/sink/struct.Flush.html" title="struct futures::sink::Flush">Flush</a><'_, Si, Item> <span class="where fmt-newline">where<br> Si: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> + <a class="trait" href="../../futures/sink/trait.Sink.html" title="trait futures::sink::Sink">Sink</a><Item> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></span><span class="where fmt-newline"> type <a href="../../futures/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <Si as <a class="trait" href="../../futures/sink/trait.Sink.html" title="trait futures::sink::Sink">Sink</a><Item>>::<a class="type" href="../../futures/sink/trait.Sink.html#associatedtype.Error" title="type futures::sink::Sink::Error">Error</a>>;</span></code></span></div></span></span><br> <span class="where">where<br> Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a></span>,
|
||
{ ... }
|
||
<div class="item-spacer"></div> pub fn <a href="#method.send" class="fnname">send</a>(&mut self, item: Item) -> <a class="struct" href="../../futures/sink/struct.Send.html" title="struct futures::sink::Send">Send</a><'_, Self, Item><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../../futures/sink/struct.Send.html" title="struct futures::sink::Send">Send</a><'_, Si, Item></h3><code class="content"><span class="where fmt-newline">impl<'_, Si, Item> <a class="trait" href="../../futures/future/trait.Future.html" title="trait futures::future::Future">Future</a> for <a class="struct" href="../../futures/sink/struct.Send.html" title="struct futures::sink::Send">Send</a><'_, Si, Item> <span class="where fmt-newline">where<br> Si: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> + <a class="trait" href="../../futures/sink/trait.Sink.html" title="trait futures::sink::Sink">Sink</a><Item> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></span><span class="where fmt-newline"> type <a href="../../futures/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <Si as <a class="trait" href="../../futures/sink/trait.Sink.html" title="trait futures::sink::Sink">Sink</a><Item>>::<a class="type" href="../../futures/sink/trait.Sink.html#associatedtype.Error" title="type futures::sink::Sink::Error">Error</a>>;</span></code></span></div></span></span><br> <span class="where">where<br> Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a></span>,
|
||
{ ... }
|
||
<div class="item-spacer"></div> pub fn <a href="#method.feed" class="fnname">feed</a>(&mut self, item: Item) -> <a class="struct" href="../../futures/sink/struct.Feed.html" title="struct futures::sink::Feed">Feed</a><'_, Self, Item><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../../futures/sink/struct.Feed.html" title="struct futures::sink::Feed">Feed</a><'_, Si, Item></h3><code class="content"><span class="where fmt-newline">impl<'_, Si, Item> <a class="trait" href="../../futures/future/trait.Future.html" title="trait futures::future::Future">Future</a> for <a class="struct" href="../../futures/sink/struct.Feed.html" title="struct futures::sink::Feed">Feed</a><'_, Si, Item> <span class="where fmt-newline">where<br> Si: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> + <a class="trait" href="../../futures/sink/trait.Sink.html" title="trait futures::sink::Sink">Sink</a><Item> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></span><span class="where fmt-newline"> type <a href="../../futures/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <Si as <a class="trait" href="../../futures/sink/trait.Sink.html" title="trait futures::sink::Sink">Sink</a><Item>>::<a class="type" href="../../futures/sink/trait.Sink.html#associatedtype.Error" title="type futures::sink::Sink::Error">Error</a>>;</span></code></span></div></span></span><br> <span class="where">where<br> Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a></span>,
|
||
{ ... }
|
||
<div class="item-spacer"></div> pub fn <a href="#method.send_all" class="fnname">send_all</a><St>(<br> &'a mut self, <br> stream: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'a mut </a>St<br> ) -> <a class="struct" href="../../futures/sink/struct.SendAll.html" title="struct futures::sink::SendAll">SendAll</a><'a, Self, St><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../../futures/sink/struct.SendAll.html" title="struct futures::sink::SendAll">SendAll</a><'_, Si, St></h3><code class="content"><span class="where fmt-newline">impl<'_, Si, St, Ok, Error> <a class="trait" href="../../futures/future/trait.Future.html" title="trait futures::future::Future">Future</a> for <a class="struct" href="../../futures/sink/struct.SendAll.html" title="struct futures::sink::SendAll">SendAll</a><'_, Si, St> <span class="where fmt-newline">where<br> Si: <a class="trait" href="../../futures/sink/trait.Sink.html" title="trait futures::sink::Sink">Sink</a><Ok, Error = Error> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> St: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a><Item = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Ok, Error>> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></span><span class="where fmt-newline"> type <a href="../../futures/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, Error>;</span></code></span></div></span></span><br> <span class="where">where<br> Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,<br> St: <a class="trait" href="../../futures/stream/trait.TryStream.html" title="trait futures::stream::TryStream">TryStream</a><Ok = Item, Error = Self::<a class="type" href="../../futures/sink/trait.Sink.html#associatedtype.Error" title="type futures::sink::Sink::Error">Error</a>> + <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
|
||
{ ... }
|
||
<div class="item-spacer"></div> pub fn <a href="#method.left_sink" class="fnname">left_sink</a><Si2>(self) -> <a class="enum" href="../../futures/future/enum.Either.html" title="enum futures::future::Either">Either</a><Self, Si2><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="enum" href="../../futures/future/enum.Either.html" title="enum futures::future::Either">Either</a><A, B></h3><code class="content"><span class="where fmt-newline">impl<A, B> <a class="trait" href="../../futures/future/trait.Future.html" title="trait futures::future::Future">Future</a> for <a class="enum" href="../../futures/future/enum.Either.html" title="enum futures::future::Either">Either</a><A, B> <span class="where fmt-newline">where<br> B: <a class="trait" href="../../futures/future/trait.Future.html" title="trait futures::future::Future">Future</a><Output = <A as <a class="trait" href="../../futures/future/trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="type" href="../../futures/future/trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>>,<br> A: <a class="trait" href="../../futures/future/trait.Future.html" title="trait futures::future::Future">Future</a>, </span></span><span class="where fmt-newline"> type <a href="../../futures/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = <A as <a class="trait" href="../../futures/future/trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="type" href="../../futures/future/trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>;</span></code></span></div></span></span><br> <span class="where">where<br> Si2: <a class="trait" href="../../futures/sink/trait.Sink.html" title="trait futures::sink::Sink">Sink</a><Item, Error = Self::<a class="type" href="../../futures/sink/trait.Sink.html#associatedtype.Error" title="type futures::sink::Sink::Error">Error</a>></span>,
|
||
{ ... }
|
||
<div class="item-spacer"></div> pub fn <a href="#method.right_sink" class="fnname">right_sink</a><Si1>(self) -> <a class="enum" href="../../futures/future/enum.Either.html" title="enum futures::future::Either">Either</a><Si1, Self><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="enum" href="../../futures/future/enum.Either.html" title="enum futures::future::Either">Either</a><A, B></h3><code class="content"><span class="where fmt-newline">impl<A, B> <a class="trait" href="../../futures/future/trait.Future.html" title="trait futures::future::Future">Future</a> for <a class="enum" href="../../futures/future/enum.Either.html" title="enum futures::future::Either">Either</a><A, B> <span class="where fmt-newline">where<br> B: <a class="trait" href="../../futures/future/trait.Future.html" title="trait futures::future::Future">Future</a><Output = <A as <a class="trait" href="../../futures/future/trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="type" href="../../futures/future/trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>>,<br> A: <a class="trait" href="../../futures/future/trait.Future.html" title="trait futures::future::Future">Future</a>, </span></span><span class="where fmt-newline"> type <a href="../../futures/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = <A as <a class="trait" href="../../futures/future/trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="type" href="../../futures/future/trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>;</span></code></span></div></span></span><br> <span class="where">where<br> Si1: <a class="trait" href="../../futures/sink/trait.Sink.html" title="trait futures::sink::Sink">Sink</a><Item, Error = Self::<a class="type" href="../../futures/sink/trait.Sink.html#associatedtype.Error" title="type futures::sink::Sink::Error">Error</a>></span>,
|
||
{ ... }
|
||
<div class="item-spacer"></div> pub fn <a href="#method.poll_ready_unpin" class="fnname">poll_ready_unpin</a>(<br> &mut self, <br> cx: &mut <a class="struct" href="../../futures/task/struct.Context.html" title="struct futures::task::Context">Context</a><'_><br> ) -> <a class="enum" href="../../futures/task/enum.Poll.html" title="enum futures::task::Poll">Poll</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, Self::<a class="type" href="../../futures/sink/trait.Sink.html#associatedtype.Error" title="type futures::sink::Sink::Error">Error</a>>><br> <span class="where">where<br> Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a></span>,
|
||
{ ... }
|
||
<div class="item-spacer"></div> pub fn <a href="#method.start_send_unpin" class="fnname">start_send_unpin</a>(&mut self, item: Item) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, Self::<a class="type" href="../../futures/sink/trait.Sink.html#associatedtype.Error" title="type futures::sink::Sink::Error">Error</a>><br> <span class="where">where<br> Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a></span>,
|
||
{ ... }
|
||
<div class="item-spacer"></div> pub fn <a href="#method.poll_flush_unpin" class="fnname">poll_flush_unpin</a>(<br> &mut self, <br> cx: &mut <a class="struct" href="../../futures/task/struct.Context.html" title="struct futures::task::Context">Context</a><'_><br> ) -> <a class="enum" href="../../futures/task/enum.Poll.html" title="enum futures::task::Poll">Poll</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, Self::<a class="type" href="../../futures/sink/trait.Sink.html#associatedtype.Error" title="type futures::sink::Sink::Error">Error</a>>><br> <span class="where">where<br> Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a></span>,
|
||
{ ... }
|
||
<div class="item-spacer"></div> pub fn <a href="#method.poll_close_unpin" class="fnname">poll_close_unpin</a>(<br> &mut self, <br> cx: &mut <a class="struct" href="../../futures/task/struct.Context.html" title="struct futures::task::Context">Context</a><'_><br> ) -> <a class="enum" href="../../futures/task/enum.Poll.html" title="enum futures::task::Poll">Poll</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, Self::<a class="type" href="../../futures/sink/trait.Sink.html#associatedtype.Error" title="type futures::sink::Sink::Error">Error</a>>><br> <span class="where">where<br> Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a></span>,
|
||
{ ... }
|
||
}</pre></div><div class="docblock"><p>An extension trait for <code>Sink</code>s that provides a variety of convenient
|
||
combinator functions.</p>
|
||
</div><h2 id="provided-methods" class="small-section-header">Provided methods<a href="#provided-methods" class="anchor"></a></h2><div class="methods"><h3 id="method.with" class="method"><code>pub fn <a href="#method.with" class="fnname">with</a><U, Fut, F, E>(self, f: F) -> <a class="struct" href="../../futures/sink/struct.With.html" title="struct futures::sink::With">With</a><Self, Item, U, Fut, F> <span class="where fmt-newline">where<br> E: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Self::<a class="type" href="../../futures/sink/trait.Sink.html#associatedtype.Error" title="type futures::sink::Sink::Error">Error</a>>,<br> 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>(U) -> Fut,<br> Fut: <a class="trait" href="../../futures/future/trait.Future.html" title="trait futures::future::Future">Future</a><Output = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Item, E>>, </span></code><a class="srclink" href="../../src/futures_util/sink/mod.rs.html#77-82" title="goto source code">[src]</a></h3><div class="docblock"><p>Composes a function <em>in front of</em> the sink.</p>
|
||
<p>This adapter produces a new sink that passes each value through the
|
||
given function <code>f</code> before sending it to <code>self</code>.</p>
|
||
<p>To process each value, <code>f</code> produces a <em>future</em>, which is then polled to
|
||
completion before passing its result down to the underlying sink. If the
|
||
future produces an error, that error is returned by the new sink.</p>
|
||
<p>Note that this function consumes the given sink, returning a wrapped
|
||
version, much like <code>Iterator::map</code>.</p>
|
||
</div><h3 id="method.with_flat_map" class="method"><code>pub fn <a href="#method.with_flat_map" class="fnname">with_flat_map</a><U, St, F>(self, f: F) -> <a class="struct" href="../../futures/sink/struct.WithFlatMap.html" title="struct futures::sink::WithFlatMap">WithFlatMap</a><Self, Item, U, St, F> <span class="where fmt-newline">where<br> 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>(U) -> St,<br> St: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a><Item = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Item, Self::<a class="type" href="../../futures/sink/trait.Sink.html#associatedtype.Error" title="type futures::sink::Sink::Error">Error</a>>>, </span></code><a class="srclink" href="../../src/futures_util/sink/mod.rs.html#119-123" title="goto source code">[src]</a></h3><div class="docblock"><p>Composes a function <em>in front of</em> the sink.</p>
|
||
<p>This adapter produces a new sink that passes each value through the
|
||
given function <code>f</code> before sending it to <code>self</code>.</p>
|
||
<p>To process each value, <code>f</code> produces a <em>stream</em>, of which each value
|
||
is passed to the underlying sink. A new value will not be accepted until
|
||
the stream has been drained</p>
|
||
<p>Note that this function consumes the given sink, returning a wrapped
|
||
version, much like <code>Iterator::flat_map</code>.</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">use</span> <span class="ident">futures</span>::<span class="ident">channel</span>::<span class="ident">mpsc</span>;
|
||
<span class="kw">use</span> <span class="ident">futures</span>::<span class="ident">sink</span>::<span class="ident">SinkExt</span>;
|
||
<span class="kw">use</span> <span class="ident">futures</span>::<span class="ident">stream</span>::{<span class="self">self</span>, <span class="ident">StreamExt</span>};
|
||
|
||
<span class="kw">let</span> (<span class="ident">tx</span>, <span class="ident">rx</span>) <span class="op">=</span> <span class="ident">mpsc</span>::<span class="ident">channel</span>(<span class="number">5</span>);
|
||
|
||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">tx</span> <span class="op">=</span> <span class="ident">tx</span>.<span class="ident">with_flat_map</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> {
|
||
<span class="ident">stream</span>::<span class="ident">iter</span>(<span class="macro">vec</span><span class="macro">!</span>[<span class="prelude-val">Ok</span>(<span class="number">42</span>); <span class="ident">x</span>])
|
||
});
|
||
|
||
<span class="ident">tx</span>.<span class="ident">send</span>(<span class="number">5</span>).<span class="kw">await</span>.<span class="ident">unwrap</span>();
|
||
<span class="ident">drop</span>(<span class="ident">tx</span>);
|
||
<span class="kw">let</span> <span class="ident">received</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">i32</span><span class="op">></span> <span class="op">=</span> <span class="ident">rx</span>.<span class="ident">collect</span>().<span class="kw">await</span>;
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">received</span>, <span class="macro">vec</span><span class="macro">!</span>[<span class="number">42</span>, <span class="number">42</span>, <span class="number">42</span>, <span class="number">42</span>, <span class="number">42</span>]);</pre></div>
|
||
</div><h3 id="method.sink_map_err" class="method"><code>pub fn <a href="#method.sink_map_err" class="fnname">sink_map_err</a><E, F>(self, f: F) -> <a class="struct" href="../../futures/sink/struct.SinkMapErr.html" title="struct futures::sink::SinkMapErr">SinkMapErr</a><Self, F> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(Self::<a class="type" href="../../futures/sink/trait.Sink.html#associatedtype.Error" title="type futures::sink::Sink::Error">Error</a>) -> E, </span></code><a class="srclink" href="../../src/futures_util/sink/mod.rs.html#143-146" title="goto source code">[src]</a></h3><div class="docblock"><p>Transforms the error returned by the sink.</p>
|
||
</div><h3 id="method.sink_err_into" class="method"><code>pub fn <a href="#method.sink_err_into" class="fnname">sink_err_into</a><E>(self) -> <a class="struct" href="../../futures/sink/struct.SinkErrInto.html" title="struct futures::sink::SinkErrInto">SinkErrInto</a><Self, Item, E> <span class="where fmt-newline">where<br> Self::<a class="type" href="../../futures/sink/trait.Sink.html#associatedtype.Error" title="type futures::sink::Sink::Error">Error</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><E>, </span></code><a class="srclink" href="../../src/futures_util/sink/mod.rs.html#154-157" title="goto source code">[src]</a></h3><div class="docblock"><p>Map this sink's error to a different error type using the <code>Into</code> trait.</p>
|
||
<p>If wanting to map errors of a <code>Sink + Stream</code>, use <code>.sink_err_into().err_into()</code>.</p>
|
||
</div><h3 id="method.buffer" class="method"><code>pub fn <a href="#method.buffer" class="fnname">buffer</a>(self, capacity: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="struct" href="../../futures/sink/struct.Buffer.html" title="struct futures::sink::Buffer">Buffer</a><Self, Item></code><a class="srclink" href="../../src/futures_util/sink/mod.rs.html#175-177" title="goto source code">[src]</a></h3><div class="docblock"><p>Adds a fixed-size buffer to the current sink.</p>
|
||
<p>The resulting sink will buffer up to <code>capacity</code> items when the
|
||
underlying sink is unwilling to accept additional items. Calling <code>flush</code>
|
||
on the buffered sink will attempt to both empty the buffer and complete
|
||
processing on the underlying sink.</p>
|
||
<p>Note that this function consumes the given sink, returning a wrapped
|
||
version, much like <code>Iterator::map</code>.</p>
|
||
<p>This method is only available when the <code>std</code> or <code>alloc</code> feature of this
|
||
library is activated, and it is activated by default.</p>
|
||
</div><h3 id="method.close" class="method"><code>pub fn <a href="#method.close" class="fnname">close</a>(&mut self) -> <a class="struct" href="../../futures/sink/struct.Close.html" title="struct futures::sink::Close">Close</a><'_, Self, Item><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../../futures/sink/struct.Close.html" title="struct futures::sink::Close">Close</a><'_, Si, Item></h3><code class="content"><span class="where fmt-newline">impl<'_, Si, Item> <a class="trait" href="../../futures/future/trait.Future.html" title="trait futures::future::Future">Future</a> for <a class="struct" href="../../futures/sink/struct.Close.html" title="struct futures::sink::Close">Close</a><'_, Si, Item> <span class="where fmt-newline">where<br> Si: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> + <a class="trait" href="../../futures/sink/trait.Sink.html" title="trait futures::sink::Sink">Sink</a><Item> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></span><span class="where fmt-newline"> type <a href="../../futures/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <Si as <a class="trait" href="../../futures/sink/trait.Sink.html" title="trait futures::sink::Sink">Sink</a><Item>>::<a class="type" href="../../futures/sink/trait.Sink.html#associatedtype.Error" title="type futures::sink::Sink::Error">Error</a>>;</span></code></span></div></span></span> <span class="where fmt-newline">where<br> Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>, </span></code><a class="srclink" href="../../src/futures_util/sink/mod.rs.html#183-185" title="goto source code">[src]</a></h3><div class="docblock"><p>Close the sink.</p>
|
||
</div><h3 id="method.fanout" class="method"><code>pub fn <a href="#method.fanout" class="fnname">fanout</a><Si>(self, other: Si) -> <a class="struct" href="../../futures/sink/struct.Fanout.html" title="struct futures::sink::Fanout">Fanout</a><Self, Si> <span class="where fmt-newline">where<br> Item: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,<br> Si: <a class="trait" href="../../futures/sink/trait.Sink.html" title="trait futures::sink::Sink">Sink</a><Item, Error = Self::<a class="type" href="../../futures/sink/trait.Sink.html#associatedtype.Error" title="type futures::sink::Sink::Error">Error</a>>, </span></code><a class="srclink" href="../../src/futures_util/sink/mod.rs.html#194-198" title="goto source code">[src]</a></h3><div class="docblock"><p>Fanout items to multiple sinks.</p>
|
||
<p>This adapter clones each incoming item and forwards it to both this as well as
|
||
the other sink at the same time.</p>
|
||
</div><h3 id="method.flush" class="method"><code>pub fn <a href="#method.flush" class="fnname">flush</a>(&mut self) -> <a class="struct" href="../../futures/sink/struct.Flush.html" title="struct futures::sink::Flush">Flush</a><'_, Self, Item><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../../futures/sink/struct.Flush.html" title="struct futures::sink::Flush">Flush</a><'_, Si, Item></h3><code class="content"><span class="where fmt-newline">impl<'_, Si, Item> <a class="trait" href="../../futures/future/trait.Future.html" title="trait futures::future::Future">Future</a> for <a class="struct" href="../../futures/sink/struct.Flush.html" title="struct futures::sink::Flush">Flush</a><'_, Si, Item> <span class="where fmt-newline">where<br> Si: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> + <a class="trait" href="../../futures/sink/trait.Sink.html" title="trait futures::sink::Sink">Sink</a><Item> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></span><span class="where fmt-newline"> type <a href="../../futures/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <Si as <a class="trait" href="../../futures/sink/trait.Sink.html" title="trait futures::sink::Sink">Sink</a><Item>>::<a class="type" href="../../futures/sink/trait.Sink.html#associatedtype.Error" title="type futures::sink::Sink::Error">Error</a>>;</span></code></span></div></span></span> <span class="where fmt-newline">where<br> Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>, </span></code><a class="srclink" href="../../src/futures_util/sink/mod.rs.html#207-209" title="goto source code">[src]</a></h3><div class="docblock"><p>Flush the sink, processing all pending items.</p>
|
||
<p>This adapter is intended to be used when you want to stop sending to the sink
|
||
until all current requests are processed.</p>
|
||
</div><h3 id="method.send" class="method"><code>pub fn <a href="#method.send" class="fnname">send</a>(&mut self, item: Item) -> <a class="struct" href="../../futures/sink/struct.Send.html" title="struct futures::sink::Send">Send</a><'_, Self, Item><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../../futures/sink/struct.Send.html" title="struct futures::sink::Send">Send</a><'_, Si, Item></h3><code class="content"><span class="where fmt-newline">impl<'_, Si, Item> <a class="trait" href="../../futures/future/trait.Future.html" title="trait futures::future::Future">Future</a> for <a class="struct" href="../../futures/sink/struct.Send.html" title="struct futures::sink::Send">Send</a><'_, Si, Item> <span class="where fmt-newline">where<br> Si: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> + <a class="trait" href="../../futures/sink/trait.Sink.html" title="trait futures::sink::Sink">Sink</a><Item> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></span><span class="where fmt-newline"> type <a href="../../futures/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <Si as <a class="trait" href="../../futures/sink/trait.Sink.html" title="trait futures::sink::Sink">Sink</a><Item>>::<a class="type" href="../../futures/sink/trait.Sink.html#associatedtype.Error" title="type futures::sink::Sink::Error">Error</a>>;</span></code></span></div></span></span> <span class="where fmt-newline">where<br> Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>, </span></code><a class="srclink" href="../../src/futures_util/sink/mod.rs.html#220-222" title="goto source code">[src]</a></h3><div class="docblock"><p>A future that completes after the given item has been fully processed
|
||
into the sink, including flushing.</p>
|
||
<p>Note that, <strong>because of the flushing requirement, it is usually better
|
||
to batch together items to send via <code>feed</code> or <code>send_all</code>,
|
||
rather than flushing between each item.</strong></p>
|
||
</div><h3 id="method.feed" class="method"><code>pub fn <a href="#method.feed" class="fnname">feed</a>(&mut self, item: Item) -> <a class="struct" href="../../futures/sink/struct.Feed.html" title="struct futures::sink::Feed">Feed</a><'_, Self, Item><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../../futures/sink/struct.Feed.html" title="struct futures::sink::Feed">Feed</a><'_, Si, Item></h3><code class="content"><span class="where fmt-newline">impl<'_, Si, Item> <a class="trait" href="../../futures/future/trait.Future.html" title="trait futures::future::Future">Future</a> for <a class="struct" href="../../futures/sink/struct.Feed.html" title="struct futures::sink::Feed">Feed</a><'_, Si, Item> <span class="where fmt-newline">where<br> Si: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> + <a class="trait" href="../../futures/sink/trait.Sink.html" title="trait futures::sink::Sink">Sink</a><Item> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></span><span class="where fmt-newline"> type <a href="../../futures/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <Si as <a class="trait" href="../../futures/sink/trait.Sink.html" title="trait futures::sink::Sink">Sink</a><Item>>::<a class="type" href="../../futures/sink/trait.Sink.html#associatedtype.Error" title="type futures::sink::Sink::Error">Error</a>>;</span></code></span></div></span></span> <span class="where fmt-newline">where<br> Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>, </span></code><a class="srclink" href="../../src/futures_util/sink/mod.rs.html#233-235" title="goto source code">[src]</a></h3><div class="docblock"><p>A future that completes after the given item has been received
|
||
by the sink.</p>
|
||
<p>Unlike <code>send</code>, the returned future does not flush the sink.
|
||
It is the caller's responsibility to ensure all pending items
|
||
are processed, which can be done via <code>flush</code> or <code>close</code>.</p>
|
||
</div><h3 id="method.send_all" class="method"><code>pub fn <a href="#method.send_all" class="fnname">send_all</a><St>(&'a mut self, stream: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'a mut </a>St) -> <a class="struct" href="../../futures/sink/struct.SendAll.html" title="struct futures::sink::SendAll">SendAll</a><'a, Self, St><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../../futures/sink/struct.SendAll.html" title="struct futures::sink::SendAll">SendAll</a><'_, Si, St></h3><code class="content"><span class="where fmt-newline">impl<'_, Si, St, Ok, Error> <a class="trait" href="../../futures/future/trait.Future.html" title="trait futures::future::Future">Future</a> for <a class="struct" href="../../futures/sink/struct.SendAll.html" title="struct futures::sink::SendAll">SendAll</a><'_, Si, St> <span class="where fmt-newline">where<br> Si: <a class="trait" href="../../futures/sink/trait.Sink.html" title="trait futures::sink::Sink">Sink</a><Ok, Error = Error> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> St: <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a><Item = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Ok, Error>> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></span><span class="where fmt-newline"> type <a href="../../futures/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, Error>;</span></code></span></div></span></span> <span class="where fmt-newline">where<br> Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,<br> St: <a class="trait" href="../../futures/stream/trait.TryStream.html" title="trait futures::stream::TryStream">TryStream</a><Ok = Item, Error = Self::<a class="type" href="../../futures/sink/trait.Sink.html#associatedtype.Error" title="type futures::sink::Sink::Error">Error</a>> + <a class="trait" href="../../futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a class="srclink" href="../../src/futures_util/sink/mod.rs.html#251-255" title="goto source code">[src]</a></h3><div class="docblock"><p>A future that completes after the given stream has been fully processed
|
||
into the sink, including flushing.</p>
|
||
<p>This future will drive the stream to keep producing items until it is
|
||
exhausted, sending each item to the sink. It will complete once both the
|
||
stream is exhausted, the sink has received all items, and the sink has
|
||
been flushed. Note that the sink is <strong>not</strong> closed.</p>
|
||
<p>Doing <code>sink.send_all(stream)</code> is roughly equivalent to
|
||
<code>stream.forward(sink)</code>. The returned future will exhaust all items from
|
||
<code>stream</code> and send them to <code>self</code>.</p>
|
||
</div><h3 id="method.left_sink" class="method"><code>pub fn <a href="#method.left_sink" class="fnname">left_sink</a><Si2>(self) -> <a class="enum" href="../../futures/future/enum.Either.html" title="enum futures::future::Either">Either</a><Self, Si2><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="enum" href="../../futures/future/enum.Either.html" title="enum futures::future::Either">Either</a><A, B></h3><code class="content"><span class="where fmt-newline">impl<A, B> <a class="trait" href="../../futures/future/trait.Future.html" title="trait futures::future::Future">Future</a> for <a class="enum" href="../../futures/future/enum.Either.html" title="enum futures::future::Either">Either</a><A, B> <span class="where fmt-newline">where<br> B: <a class="trait" href="../../futures/future/trait.Future.html" title="trait futures::future::Future">Future</a><Output = <A as <a class="trait" href="../../futures/future/trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="type" href="../../futures/future/trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>>,<br> A: <a class="trait" href="../../futures/future/trait.Future.html" title="trait futures::future::Future">Future</a>, </span></span><span class="where fmt-newline"> type <a href="../../futures/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = <A as <a class="trait" href="../../futures/future/trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="type" href="../../futures/future/trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>;</span></code></span></div></span></span> <span class="where fmt-newline">where<br> Si2: <a class="trait" href="../../futures/sink/trait.Sink.html" title="trait futures::sink::Sink">Sink</a><Item, Error = Self::<a class="type" href="../../futures/sink/trait.Sink.html#associatedtype.Error" title="type futures::sink::Sink::Error">Error</a>>, </span></code><a class="srclink" href="../../src/futures_util/sink/mod.rs.html#267-270" title="goto source code">[src]</a></h3><div class="docblock"><p>Wrap this sink in an <code>Either</code> sink, making it the left-hand variant
|
||
of that <code>Either</code>.</p>
|
||
<p>This can be used in combination with the <code>right_sink</code> method to write <code>if</code>
|
||
statements that evaluate to different streams in different branches.</p>
|
||
</div><h3 id="method.right_sink" class="method"><code>pub fn <a href="#method.right_sink" class="fnname">right_sink</a><Si1>(self) -> <a class="enum" href="../../futures/future/enum.Either.html" title="enum futures::future::Either">Either</a><Si1, Self><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="enum" href="../../futures/future/enum.Either.html" title="enum futures::future::Either">Either</a><A, B></h3><code class="content"><span class="where fmt-newline">impl<A, B> <a class="trait" href="../../futures/future/trait.Future.html" title="trait futures::future::Future">Future</a> for <a class="enum" href="../../futures/future/enum.Either.html" title="enum futures::future::Either">Either</a><A, B> <span class="where fmt-newline">where<br> B: <a class="trait" href="../../futures/future/trait.Future.html" title="trait futures::future::Future">Future</a><Output = <A as <a class="trait" href="../../futures/future/trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="type" href="../../futures/future/trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>>,<br> A: <a class="trait" href="../../futures/future/trait.Future.html" title="trait futures::future::Future">Future</a>, </span></span><span class="where fmt-newline"> type <a href="../../futures/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = <A as <a class="trait" href="../../futures/future/trait.Future.html" title="trait futures::future::Future">Future</a>>::<a class="type" href="../../futures/future/trait.Future.html#associatedtype.Output" title="type futures::future::Future::Output">Output</a>;</span></code></span></div></span></span> <span class="where fmt-newline">where<br> Si1: <a class="trait" href="../../futures/sink/trait.Sink.html" title="trait futures::sink::Sink">Sink</a><Item, Error = Self::<a class="type" href="../../futures/sink/trait.Sink.html#associatedtype.Error" title="type futures::sink::Sink::Error">Error</a>>, </span></code><a class="srclink" href="../../src/futures_util/sink/mod.rs.html#280-283" title="goto source code">[src]</a></h3><div class="docblock"><p>Wrap this stream in an <code>Either</code> stream, making it the right-hand variant
|
||
of that <code>Either</code>.</p>
|
||
<p>This can be used in combination with the <code>left_sink</code> method to write <code>if</code>
|
||
statements that evaluate to different streams in different branches.</p>
|
||
</div><h3 id="method.poll_ready_unpin" class="method"><code>pub fn <a href="#method.poll_ready_unpin" class="fnname">poll_ready_unpin</a>(<br> &mut self, <br> cx: &mut <a class="struct" href="../../futures/task/struct.Context.html" title="struct futures::task::Context">Context</a><'_><br>) -> <a class="enum" href="../../futures/task/enum.Poll.html" title="enum futures::task::Poll">Poll</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, Self::<a class="type" href="../../futures/sink/trait.Sink.html#associatedtype.Error" title="type futures::sink::Sink::Error">Error</a>>> <span class="where fmt-newline">where<br> Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>, </span></code><a class="srclink" href="../../src/futures_util/sink/mod.rs.html#301-303" title="goto source code">[src]</a></h3><div class="docblock"><p>A convenience method for calling <a href="../../futures/sink/trait.Sink.html#tymethod.poll_ready" title="Sink::poll_ready"><code>Sink::poll_ready</code></a> on <a href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="Unpin"><code>Unpin</code></a>
|
||
sink types.</p>
|
||
</div><h3 id="method.start_send_unpin" class="method"><code>pub fn <a href="#method.start_send_unpin" class="fnname">start_send_unpin</a>(&mut self, item: Item) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, Self::<a class="type" href="../../futures/sink/trait.Sink.html#associatedtype.Error" title="type futures::sink::Sink::Error">Error</a>> <span class="where fmt-newline">where<br> Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>, </span></code><a class="srclink" href="../../src/futures_util/sink/mod.rs.html#310-312" title="goto source code">[src]</a></h3><div class="docblock"><p>A convenience method for calling <a href="../../futures/sink/trait.Sink.html#tymethod.start_send" title="Sink::start_send"><code>Sink::start_send</code></a> on <a href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="Unpin"><code>Unpin</code></a>
|
||
sink types.</p>
|
||
</div><h3 id="method.poll_flush_unpin" class="method"><code>pub fn <a href="#method.poll_flush_unpin" class="fnname">poll_flush_unpin</a>(<br> &mut self, <br> cx: &mut <a class="struct" href="../../futures/task/struct.Context.html" title="struct futures::task::Context">Context</a><'_><br>) -> <a class="enum" href="../../futures/task/enum.Poll.html" title="enum futures::task::Poll">Poll</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, Self::<a class="type" href="../../futures/sink/trait.Sink.html#associatedtype.Error" title="type futures::sink::Sink::Error">Error</a>>> <span class="where fmt-newline">where<br> Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>, </span></code><a class="srclink" href="../../src/futures_util/sink/mod.rs.html#319-321" title="goto source code">[src]</a></h3><div class="docblock"><p>A convenience method for calling <a href="../../futures/sink/trait.Sink.html#tymethod.poll_flush" title="Sink::poll_flush"><code>Sink::poll_flush</code></a> on <a href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="Unpin"><code>Unpin</code></a>
|
||
sink types.</p>
|
||
</div><h3 id="method.poll_close_unpin" class="method"><code>pub fn <a href="#method.poll_close_unpin" class="fnname">poll_close_unpin</a>(<br> &mut self, <br> cx: &mut <a class="struct" href="../../futures/task/struct.Context.html" title="struct futures::task::Context">Context</a><'_><br>) -> <a class="enum" href="../../futures/task/enum.Poll.html" title="enum futures::task::Poll">Poll</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, Self::<a class="type" href="../../futures/sink/trait.Sink.html#associatedtype.Error" title="type futures::sink::Sink::Error">Error</a>>> <span class="where fmt-newline">where<br> Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>, </span></code><a class="srclink" href="../../src/futures_util/sink/mod.rs.html#328-330" title="goto source code">[src]</a></h3><div class="docblock"><p>A convenience method for calling <a href="../../futures/sink/trait.Sink.html#tymethod.poll_close" title="Sink::poll_close"><code>Sink::poll_close</code></a> on <a href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="Unpin"><code>Unpin</code></a>
|
||
sink types.</p>
|
||
</div></div><span class="loading-content">Loading content...</span><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"><h3 id="impl-SinkExt%3CItem%3E" class="impl"><code class="in-band">impl<T, Item> SinkExt<Item> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="../../futures/sink/trait.Sink.html" title="trait futures::sink::Sink">Sink</a><Item> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href="#impl-SinkExt%3CItem%3E" class="anchor"></a><a class="srclink" href="../../src/futures_util/sink/mod.rs.html#61" title="goto source code">[src]</a></h3><div class="impl-items"></div></div><span class="loading-content">Loading content...</span><script type="text/javascript" src="../../implementors/futures_util/sink/trait.SinkExt.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../../" data-current-crate="futures"></div>
|
||
<script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html> |