blob: a28efdbd81f221c68cd042e0a874e1a1dc0f346d [file] [log] [blame]
<!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="Write bytes asynchronously."><meta name="keywords" content="rust, rustlang, rust-lang, AsyncWrite"><title>AsyncWrite in futures_util::io - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="../../normalize.css"><link rel="stylesheet" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../../ayu.css" disabled><link rel="stylesheet" href="../../dark.css" disabled><link rel="stylesheet" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../main.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../../futures_util/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../futures_util/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">AsyncWrite</a></h2><div class="sidebar-elems"><section><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.poll_close">poll_close</a></li><li><a href="#tymethod.poll_flush">poll_flush</a></li><li><a href="#tymethod.poll_write">poll_write</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.poll_write_vectored">poll_write_vectored</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-AsyncWrite-for-%26mut%20T">&amp;mut T</a></li><li><a href="#impl-AsyncWrite-for-Box%3CT%2C%20Global%3E">Box&lt;T, Global&gt;</a></li><li><a href="#impl-AsyncWrite-for-Pin%3CP%3E">Pin&lt;P&gt;</a></li><li><a href="#impl-AsyncWrite-for-Vec%3Cu8%2C%20Global%3E">Vec&lt;u8, Global&gt;</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><h2><a href="index.html">In futures_util::io</a></h2></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn">Trait <a href="../index.html">futures_util</a>::<wbr><a href="index.html">io</a>::<wbr><a class="trait" href="#">AsyncWrite</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="srclink" href="../../src/futures_io/lib.rs.html#110">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="item-decl"><pre class="rust trait"><code>pub trait AsyncWrite {
fn <a href="#tymethod.poll_write" class="fnname">poll_write</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self: Pin&lt;&amp;mut Self&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut Context&lt;'_&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;buf: &amp;[u8]<br>&nbsp;&nbsp;&nbsp;&nbsp;) -&gt; Poll&lt;Result&lt;usize, Error&gt;&gt;;
<span class="item-spacer"></span> fn <a href="#tymethod.poll_flush" class="fnname">poll_flush</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self: Pin&lt;&amp;mut Self&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut Context&lt;'_&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;) -&gt; Poll&lt;Result&lt;(), Error&gt;&gt;;
<span class="item-spacer"></span> fn <a href="#tymethod.poll_close" class="fnname">poll_close</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self: Pin&lt;&amp;mut Self&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut Context&lt;'_&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;) -&gt; Poll&lt;Result&lt;(), Error&gt;&gt;;
fn <a href="#method.poll_write_vectored" class="fnname">poll_write_vectored</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self: Pin&lt;&amp;mut Self&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut Context&lt;'_&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bufs: &amp;[IoSlice&lt;'_&gt;]<br>&nbsp;&nbsp;&nbsp;&nbsp;) -&gt; Poll&lt;Result&lt;usize, Error&gt;&gt; { ... }
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Write bytes asynchronously.</p>
<p>This trait is analogous to the <code>std::io::Write</code> trait, but integrates
with the asynchronous task system. In particular, the <code>poll_write</code>
method, unlike <code>Write::write</code>, will automatically queue the current task
for wakeup and return if the writer cannot take more data, rather than blocking
the calling thread.</p>
</div></details><h2 id="required-methods" class="small-section-header">Required Methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle method-toggle" open><summary><section id="tymethod.poll_write" class="method has-srclink"><a class="srclink rightside" href="../../src/futures_io/lib.rs.html#129-133">source</a><h4 class="code-header">fn <a href="#tymethod.poll_write" class="fnname">poll_write</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: Pin&lt;&amp;mut Self&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut Context&lt;'_&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;buf: &amp;[u8]<br>) -&gt; Poll&lt;Result&lt;usize, Error&gt;&gt;</h4></section></summary><div class="docblock"><p>Attempt to write bytes from <code>buf</code> into the object.</p>
<p>On success, returns <code>Poll::Ready(Ok(num_bytes_written))</code>.</p>
<p>If the object is not ready for writing, the method returns
<code>Poll::Pending</code> and arranges for the current task (via
<code>cx.waker().wake_by_ref()</code>) to receive a notification when the object becomes
writable or is closed.</p>
<h5 id="implementation"><a href="#implementation">Implementation</a></h5>
<p>This function may not return errors of kind <code>WouldBlock</code> or
<code>Interrupted</code>. Implementations must convert <code>WouldBlock</code> into
<code>Poll::Pending</code> and either internally retry or convert
<code>Interrupted</code> into another error kind.</p>
<p><code>poll_write</code> must try to make progress by flushing the underlying object if
that is the only way the underlying object can become writable again.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="tymethod.poll_flush" class="method has-srclink"><a class="srclink rightside" href="../../src/futures_io/lib.rs.html#190">source</a><h4 class="code-header">fn <a href="#tymethod.poll_flush" class="fnname">poll_flush</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: Pin&lt;&amp;mut Self&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut Context&lt;'_&gt;<br>) -&gt; Poll&lt;Result&lt;(), Error&gt;&gt;</h4></section></summary><div class="docblock"><p>Attempt to flush the object, ensuring that any buffered data reach
their destination.</p>
<p>On success, returns <code>Poll::Ready(Ok(()))</code>.</p>
<p>If flushing cannot immediately complete, this method returns
<code>Poll::Pending</code> and arranges for the current task (via
<code>cx.waker().wake_by_ref()</code>) to receive a notification when the object can make
progress towards flushing.</p>
<h5 id="implementation-1"><a href="#implementation-1">Implementation</a></h5>
<p>This function may not return errors of kind <code>WouldBlock</code> or
<code>Interrupted</code>. Implementations must convert <code>WouldBlock</code> into
<code>Poll::Pending</code> and either internally retry or convert
<code>Interrupted</code> into another error kind.</p>
<p>It only makes sense to do anything here if you actually buffer data.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="tymethod.poll_close" class="method has-srclink"><a class="srclink rightside" href="../../src/futures_io/lib.rs.html#207">source</a><h4 class="code-header">fn <a href="#tymethod.poll_close" class="fnname">poll_close</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: Pin&lt;&amp;mut Self&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut Context&lt;'_&gt;<br>) -&gt; Poll&lt;Result&lt;(), Error&gt;&gt;</h4></section></summary><div class="docblock"><p>Attempt to close the object.</p>
<p>On success, returns <code>Poll::Ready(Ok(()))</code>.</p>
<p>If closing cannot immediately complete, this function returns
<code>Poll::Pending</code> and arranges for the current task (via
<code>cx.waker().wake_by_ref()</code>) to receive a notification when the object can make
progress towards closing.</p>
<h5 id="implementation-2"><a href="#implementation-2">Implementation</a></h5>
<p>This function may not return errors of kind <code>WouldBlock</code> or
<code>Interrupted</code>. Implementations must convert <code>WouldBlock</code> into
<code>Poll::Pending</code> and either internally retry or convert
<code>Interrupted</code> into another error kind.</p>
</div></details></div><h2 id="provided-methods" class="small-section-header">Provided Methods<a href="#provided-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.poll_write_vectored" class="method has-srclink"><a class="srclink rightside" href="../../src/futures_io/lib.rs.html#158-162">source</a><h4 class="code-header">fn <a href="#method.poll_write_vectored" class="fnname">poll_write_vectored</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: Pin&lt;&amp;mut Self&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut Context&lt;'_&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;bufs: &amp;[IoSlice&lt;'_&gt;]<br>) -&gt; Poll&lt;Result&lt;usize, Error&gt;&gt;</h4></section></summary><div class="docblock"><p>Attempt to write bytes from <code>bufs</code> into the object using vectored
IO operations.</p>
<p>This method is similar to <code>poll_write</code>, but allows data from multiple buffers to be written
using a single operation.</p>
<p>On success, returns <code>Poll::Ready(Ok(num_bytes_written))</code>.</p>
<p>If the object is not ready for writing, the method returns
<code>Poll::Pending</code> and arranges for the current task (via
<code>cx.waker().wake_by_ref()</code>) to receive a notification when the object becomes
writable or is closed.</p>
<p>By default, this method delegates to using <code>poll_write</code> on the first
nonempty buffer in <code>bufs</code>, or an empty one if none exists. Objects which
support vectored IO should override this method.</p>
<h5 id="implementation-3"><a href="#implementation-3">Implementation</a></h5>
<p>This function may not return errors of kind <code>WouldBlock</code> or
<code>Interrupted</code>. Implementations must convert <code>WouldBlock</code> into
<code>Poll::Pending</code> and either internally retry or convert
<code>Interrupted</code> into another error kind.</p>
</div></details></div><h2 id="foreign-impls" class="small-section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-AsyncWrite-for-%26mut%20T" class="impl has-srclink"><a class="srclink rightside" href="../../src/futures_io/lib.rs.html#406">source</a><a href="#impl-AsyncWrite-for-%26mut%20T" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="trait.AsyncWrite.html" title="trait futures_util::io::AsyncWrite">AsyncWrite</a> for &amp;mut T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="trait.AsyncWrite.html" title="trait futures_util::io::AsyncWrite">AsyncWrite</a> + Unpin + ?Sized,</span></h3></section></summary><div class="impl-items"><section id="method.poll_write" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/futures_io/lib.rs.html#407">source</a><a href="#method.poll_write" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.poll_write" class="fnname">poll_write</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: Pin&lt;&amp;mut &amp;mut T&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut Context&lt;'_&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;buf: &amp;[u8]<br>) -&gt; Poll&lt;Result&lt;usize, Error&gt;&gt;</h4></section><section id="method.poll_write_vectored-1" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/futures_io/lib.rs.html#407">source</a><a href="#method.poll_write_vectored-1" class="anchor"></a><h4 class="code-header">fn <a href="#method.poll_write_vectored" class="fnname">poll_write_vectored</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: Pin&lt;&amp;mut &amp;mut T&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut Context&lt;'_&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;bufs: &amp;[IoSlice&lt;'_&gt;]<br>) -&gt; Poll&lt;Result&lt;usize, Error&gt;&gt;</h4></section><section id="method.poll_flush" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/futures_io/lib.rs.html#407">source</a><a href="#method.poll_flush" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.poll_flush" class="fnname">poll_flush</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: Pin&lt;&amp;mut &amp;mut T&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut Context&lt;'_&gt;<br>) -&gt; Poll&lt;Result&lt;(), Error&gt;&gt;</h4></section><section id="method.poll_close" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/futures_io/lib.rs.html#407">source</a><a href="#method.poll_close" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.poll_close" class="fnname">poll_close</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: Pin&lt;&amp;mut &amp;mut T&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut Context&lt;'_&gt;<br>) -&gt; Poll&lt;Result&lt;(), Error&gt;&gt;</h4></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-AsyncWrite-for-Pin%3CP%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/futures_io/lib.rs.html#410">source</a><a href="#impl-AsyncWrite-for-Pin%3CP%3E" class="anchor"></a><h3 class="code-header">impl&lt;P&gt; <a class="trait" href="trait.AsyncWrite.html" title="trait futures_util::io::AsyncWrite">AsyncWrite</a> for Pin&lt;P&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P: DerefMut + Unpin,<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;P as Deref&gt;::Target: <a class="trait" href="trait.AsyncWrite.html" title="trait futures_util::io::AsyncWrite">AsyncWrite</a>,</span></h3></section></summary><div class="impl-items"><section id="method.poll_write-1" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/futures_io/lib.rs.html#415-419">source</a><a href="#method.poll_write-1" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.poll_write" class="fnname">poll_write</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: Pin&lt;&amp;mut Pin&lt;P&gt;&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut Context&lt;'_&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;buf: &amp;[u8]<br>) -&gt; Poll&lt;Result&lt;usize, Error&gt;&gt;</h4></section><section id="method.poll_write_vectored-2" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/futures_io/lib.rs.html#423-427">source</a><a href="#method.poll_write_vectored-2" class="anchor"></a><h4 class="code-header">fn <a href="#method.poll_write_vectored" class="fnname">poll_write_vectored</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: Pin&lt;&amp;mut Pin&lt;P&gt;&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut Context&lt;'_&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;bufs: &amp;[IoSlice&lt;'_&gt;]<br>) -&gt; Poll&lt;Result&lt;usize, Error&gt;&gt;</h4></section><section id="method.poll_flush-1" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/futures_io/lib.rs.html#431">source</a><a href="#method.poll_flush-1" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.poll_flush" class="fnname">poll_flush</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: Pin&lt;&amp;mut Pin&lt;P&gt;&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut Context&lt;'_&gt;<br>) -&gt; Poll&lt;Result&lt;(), Error&gt;&gt;</h4></section><section id="method.poll_close-1" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/futures_io/lib.rs.html#435">source</a><a href="#method.poll_close-1" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.poll_close" class="fnname">poll_close</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: Pin&lt;&amp;mut Pin&lt;P&gt;&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut Context&lt;'_&gt;<br>) -&gt; Poll&lt;Result&lt;(), Error&gt;&gt;</h4></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-AsyncWrite-for-Vec%3Cu8%2C%20Global%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/futures_io/lib.rs.html#468">source</a><a href="#impl-AsyncWrite-for-Vec%3Cu8%2C%20Global%3E" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="trait.AsyncWrite.html" title="trait futures_util::io::AsyncWrite">AsyncWrite</a> for Vec&lt;u8, Global&gt;</h3></section></summary><div class="impl-items"><section id="method.poll_write-2" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/futures_io/lib.rs.html#469">source</a><a href="#method.poll_write-2" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.poll_write" class="fnname">poll_write</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: Pin&lt;&amp;mut Vec&lt;u8, Global&gt;&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut Context&lt;'_&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;buf: &amp;[u8]<br>) -&gt; Poll&lt;Result&lt;usize, Error&gt;&gt;</h4></section><section id="method.poll_write_vectored-3" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/futures_io/lib.rs.html#469">source</a><a href="#method.poll_write_vectored-3" class="anchor"></a><h4 class="code-header">fn <a href="#method.poll_write_vectored" class="fnname">poll_write_vectored</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: Pin&lt;&amp;mut Vec&lt;u8, Global&gt;&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut Context&lt;'_&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;bufs: &amp;[IoSlice&lt;'_&gt;]<br>) -&gt; Poll&lt;Result&lt;usize, Error&gt;&gt;</h4></section><section id="method.poll_flush-2" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/futures_io/lib.rs.html#469">source</a><a href="#method.poll_flush-2" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.poll_flush" class="fnname">poll_flush</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: Pin&lt;&amp;mut Vec&lt;u8, Global&gt;&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut Context&lt;'_&gt;<br>) -&gt; Poll&lt;Result&lt;(), Error&gt;&gt;</h4></section><section id="method.poll_close-2" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/futures_io/lib.rs.html#469">source</a><a href="#method.poll_close-2" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.poll_close" class="fnname">poll_close</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: Pin&lt;&amp;mut Vec&lt;u8, Global&gt;&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut Context&lt;'_&gt;<br>) -&gt; Poll&lt;Result&lt;(), Error&gt;&gt;</h4></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-AsyncWrite-for-Box%3CT%2C%20Global%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/futures_io/lib.rs.html#402">source</a><a href="#impl-AsyncWrite-for-Box%3CT%2C%20Global%3E" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="trait.AsyncWrite.html" title="trait futures_util::io::AsyncWrite">AsyncWrite</a> for Box&lt;T, Global&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="trait.AsyncWrite.html" title="trait futures_util::io::AsyncWrite">AsyncWrite</a> + Unpin + ?Sized,</span></h3></section></summary><div class="impl-items"><section id="method.poll_write-3" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/futures_io/lib.rs.html#403">source</a><a href="#method.poll_write-3" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.poll_write" class="fnname">poll_write</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: Pin&lt;&amp;mut Box&lt;T, Global&gt;&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut Context&lt;'_&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;buf: &amp;[u8]<br>) -&gt; Poll&lt;Result&lt;usize, Error&gt;&gt;</h4></section><section id="method.poll_write_vectored-4" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/futures_io/lib.rs.html#403">source</a><a href="#method.poll_write_vectored-4" class="anchor"></a><h4 class="code-header">fn <a href="#method.poll_write_vectored" class="fnname">poll_write_vectored</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: Pin&lt;&amp;mut Box&lt;T, Global&gt;&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut Context&lt;'_&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;bufs: &amp;[IoSlice&lt;'_&gt;]<br>) -&gt; Poll&lt;Result&lt;usize, Error&gt;&gt;</h4></section><section id="method.poll_flush-3" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/futures_io/lib.rs.html#403">source</a><a href="#method.poll_flush-3" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.poll_flush" class="fnname">poll_flush</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: Pin&lt;&amp;mut Box&lt;T, Global&gt;&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut Context&lt;'_&gt;<br>) -&gt; Poll&lt;Result&lt;(), Error&gt;&gt;</h4></section><section id="method.poll_close-3" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/futures_io/lib.rs.html#403">source</a><a href="#method.poll_close-3" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.poll_close" class="fnname">poll_close</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: Pin&lt;&amp;mut Box&lt;T, Global&gt;&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut Context&lt;'_&gt;<br>) -&gt; Poll&lt;Result&lt;(), Error&gt;&gt;</h4></section></div></details><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div id="implementors-list"><section id="impl-AsyncWrite-for-Cursor%3C%26mut%20Vec%3Cu8%3E%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/futures_util/io/cursor.rs.html#222-224">source</a><a href="#impl-AsyncWrite-for-Cursor%3C%26mut%20Vec%3Cu8%3E%3E" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="trait.AsyncWrite.html" title="trait futures_util::io::AsyncWrite">AsyncWrite</a> for <a class="struct" href="struct.Cursor.html" title="struct futures_util::io::Cursor">Cursor</a>&lt;&amp;mut Vec&lt;u8&gt;&gt;</h3></section><section id="impl-AsyncWrite-for-Cursor%3C%26mut%20%5Bu8%5D%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/futures_util/io/cursor.rs.html#218-220">source</a><a href="#impl-AsyncWrite-for-Cursor%3C%26mut%20%5Bu8%5D%3E" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="trait.AsyncWrite.html" title="trait futures_util::io::AsyncWrite">AsyncWrite</a> for <a class="struct" href="struct.Cursor.html" title="struct futures_util::io::Cursor">Cursor</a>&lt;&amp;mut [u8]&gt;</h3></section><section id="impl-AsyncWrite-for-Cursor%3CBox%3C%5Bu8%5D%3E%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/futures_util/io/cursor.rs.html#230-232">source</a><a href="#impl-AsyncWrite-for-Cursor%3CBox%3C%5Bu8%5D%3E%3E" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="trait.AsyncWrite.html" title="trait futures_util::io::AsyncWrite">AsyncWrite</a> for <a class="struct" href="struct.Cursor.html" title="struct futures_util::io::Cursor">Cursor</a>&lt;Box&lt;[u8]&gt;&gt;</h3></section><section id="impl-AsyncWrite-for-Cursor%3CVec%3Cu8%3E%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/futures_util/io/cursor.rs.html#226-228">source</a><a href="#impl-AsyncWrite-for-Cursor%3CVec%3Cu8%3E%3E" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="trait.AsyncWrite.html" title="trait futures_util::io::AsyncWrite">AsyncWrite</a> for <a class="struct" href="struct.Cursor.html" title="struct futures_util::io::Cursor">Cursor</a>&lt;Vec&lt;u8&gt;&gt;</h3></section><section id="impl-AsyncWrite-for-Sink" class="impl has-srclink"><a class="srclink rightside" href="../../src/futures_util/io/sink.rs.html#34-61">source</a><a href="#impl-AsyncWrite-for-Sink" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="trait.AsyncWrite.html" title="trait futures_util::io::AsyncWrite">AsyncWrite</a> for <a class="struct" href="struct.Sink.html" title="struct futures_util::io::Sink">Sink</a></h3></section><section id="impl-AsyncWrite-for-Either%3CA%2C%20B%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/futures_util/future/either.rs.html#239-279">source</a><a href="#impl-AsyncWrite-for-Either%3CA%2C%20B%3E" class="anchor"></a><h3 class="code-header">impl&lt;A, B&gt; <a class="trait" href="trait.AsyncWrite.html" title="trait futures_util::io::AsyncWrite">AsyncWrite</a> for <a class="enum" href="../future/enum.Either.html" title="enum futures_util::future::Either">Either</a>&lt;A, B&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;A: <a class="trait" href="trait.AsyncWrite.html" title="trait futures_util::io::AsyncWrite">AsyncWrite</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;B: <a class="trait" href="trait.AsyncWrite.html" title="trait futures_util::io::AsyncWrite">AsyncWrite</a>,</span></h3></section><section id="impl-AsyncWrite-for-BufReader%3CR%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/futures_util/io/buf_reader.rs.html#168-170">source</a><a href="#impl-AsyncWrite-for-BufReader%3CR%3E" class="anchor"></a><h3 class="code-header">impl&lt;R:&nbsp;<a class="trait" href="trait.AsyncWrite.html" title="trait futures_util::io::AsyncWrite">AsyncWrite</a>&gt; <a class="trait" href="trait.AsyncWrite.html" title="trait futures_util::io::AsyncWrite">AsyncWrite</a> for <a class="struct" href="struct.BufReader.html" title="struct futures_util::io::BufReader">BufReader</a>&lt;R&gt;</h3></section><section id="impl-AsyncWrite-for-IntoAsyncRead%3CSt%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/futures_util/stream/try_stream/into_async_read.rs.html#93-112">source</a><a href="#impl-AsyncWrite-for-IntoAsyncRead%3CSt%3E" class="anchor"></a><h3 class="code-header">impl&lt;St&gt; <a class="trait" href="trait.AsyncWrite.html" title="trait futures_util::io::AsyncWrite">AsyncWrite</a> for <a class="struct" href="../stream/struct.IntoAsyncRead.html" title="struct futures_util::stream::IntoAsyncRead">IntoAsyncRead</a>&lt;St&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;St: <a class="trait" href="../stream/trait.TryStream.html" title="trait futures_util::stream::TryStream">TryStream</a>&lt;Error = Error&gt; + <a class="trait" href="trait.AsyncWrite.html" title="trait futures_util::io::AsyncWrite">AsyncWrite</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;St::<a class="associatedtype" href="../stream/trait.TryStream.html#associatedtype.Ok" title="type futures_util::stream::TryStream::Ok">Ok</a>: AsRef&lt;[u8]&gt;,</span></h3></section><section id="impl-AsyncWrite-for-AllowStdIo%3CT%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/futures_util/io/allow_std.rs.html#82-110">source</a><a href="#impl-AsyncWrite-for-AllowStdIo%3CT%3E" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="trait.AsyncWrite.html" title="trait futures_util::io::AsyncWrite">AsyncWrite</a> for <a class="struct" href="struct.AllowStdIo.html" title="struct futures_util::io::AllowStdIo">AllowStdIo</a>&lt;T&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: Write,</span></h3></section><section id="impl-AsyncWrite-for-BufWriter%3CW%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/futures_util/io/buf_writer.rs.html#151-192">source</a><a href="#impl-AsyncWrite-for-BufWriter%3CW%3E" class="anchor"></a><h3 class="code-header">impl&lt;W:&nbsp;<a class="trait" href="trait.AsyncWrite.html" title="trait futures_util::io::AsyncWrite">AsyncWrite</a>&gt; <a class="trait" href="trait.AsyncWrite.html" title="trait futures_util::io::AsyncWrite">AsyncWrite</a> for <a class="struct" href="struct.BufWriter.html" title="struct futures_util::io::BufWriter">BufWriter</a>&lt;W&gt;</h3></section><section id="impl-AsyncWrite-for-LineWriter%3CW%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/futures_util/io/line_writer.rs.html#58-155">source</a><a href="#impl-AsyncWrite-for-LineWriter%3CW%3E" class="anchor"></a><h3 class="code-header">impl&lt;W:&nbsp;<a class="trait" href="trait.AsyncWrite.html" title="trait futures_util::io::AsyncWrite">AsyncWrite</a>&gt; <a class="trait" href="trait.AsyncWrite.html" title="trait futures_util::io::AsyncWrite">AsyncWrite</a> for <a class="struct" href="struct.LineWriter.html" title="struct futures_util::io::LineWriter">LineWriter</a>&lt;W&gt;</h3></section><section id="impl-AsyncWrite-for-WriteHalf%3CW%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/futures_util/io/split.rs.html#72-96">source</a><a href="#impl-AsyncWrite-for-WriteHalf%3CW%3E" class="anchor"></a><h3 class="code-header">impl&lt;W:&nbsp;<a class="trait" href="trait.AsyncWrite.html" title="trait futures_util::io::AsyncWrite">AsyncWrite</a>&gt; <a class="trait" href="trait.AsyncWrite.html" title="trait futures_util::io::AsyncWrite">AsyncWrite</a> for <a class="struct" href="struct.WriteHalf.html" title="struct futures_util::io::WriteHalf">WriteHalf</a>&lt;W&gt;</h3></section></div><script src="../../implementors/futures_io/if_std/trait.AsyncWrite.js" data-ignore-extern-crates="core,alloc" async></script></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="futures_util" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.66.0-nightly (5c8bff74b 2022-10-21)" ></div></body></html>