blob: 40d8cddad8af65e80de53f48d6e99c2b28b8c39c [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="Writes bytes asynchronously."><meta name="keywords" content="rust, rustlang, rust-lang, AsyncWrite"><title>AsyncWrite in tokio::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="../../tokio/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="../../tokio/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_flush">poll_flush</a></li><li><a href="#tymethod.poll_shutdown">poll_shutdown</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.is_write_vectored">is_write_vectored</a></li><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%3E">Box&lt;T&gt;</a></li><li><a href="#impl-AsyncWrite-for-Cursor%3C%26mut%20Vec%3Cu8%3E%3E">Cursor&lt;&amp;mut Vec&lt;u8&gt;&gt;</a></li><li><a href="#impl-AsyncWrite-for-Cursor%3C%26mut%20%5Bu8%5D%3E">Cursor&lt;&amp;mut [u8]&gt;</a></li><li><a href="#impl-AsyncWrite-for-Cursor%3CBox%3C%5Bu8%5D%3E%3E">Cursor&lt;Box&lt;[u8]&gt;&gt;</a></li><li><a href="#impl-AsyncWrite-for-Cursor%3CVec%3Cu8%3E%3E">Cursor&lt;Vec&lt;u8&gt;&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%3E">Vec&lt;u8&gt;</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><h2><a href="index.html">In tokio::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">tokio</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/tokio/io/async_write.rs.html#45-183">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: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;buf: &amp;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]<br>&nbsp;&nbsp;&nbsp;&nbsp;) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>&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: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>&gt;&gt;;
<span class="item-spacer"></span> fn <a href="#tymethod.poll_shutdown" class="fnname">poll_shutdown</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>&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: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bufs: &amp;[<a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.IoSlice.html" title="struct std::io::IoSlice">IoSlice</a>&lt;'_&gt;]<br>&nbsp;&nbsp;&nbsp;&nbsp;) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>&gt;&gt; { ... }
<span class="item-spacer"></span> fn <a href="#method.is_write_vectored" class="fnname">is_write_vectored</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a> { ... }
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Writes bytes asynchronously.</p>
<p>The trait inherits from <a href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html"><code>std::io::Write</code></a> and indicates that an I/O object is
<strong>nonblocking</strong>. All non-blocking I/O objects must return an error when
bytes cannot be written instead of blocking the current thread.</p>
<p>Specifically, this means that the <a href="trait.AsyncWrite.html#tymethod.poll_write"><code>poll_write</code></a> function will return one of
the following:</p>
<ul>
<li>
<p><code>Poll::Ready(Ok(n))</code> means that <code>n</code> bytes of data was immediately
written.</p>
</li>
<li>
<p><code>Poll::Pending</code> means that no data was written from the buffer
provided. The I/O object is not currently writable but may become writable
in the future. Most importantly, <strong>the current future’s task is scheduled
to get unparked when the object is writable</strong>. This means that like
<code>Future::poll</code> you’ll receive a notification when the I/O object is
writable again.</p>
</li>
<li>
<p><code>Poll::Ready(Err(e))</code> for other errors are standard I/O errors coming from the
underlying object.</p>
</li>
</ul>
<p>This trait importantly means that the <a href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html#tymethod.write"><code>write</code></a> method only works in
the context of a future’s task. The object may panic if used outside of a task.</p>
<p>Note that this trait also represents that the <a href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html#tymethod.flush"><code>Write::flush</code></a> method
works very similarly to the <code>write</code> method, notably that <code>Ok(())</code> means that the
writer has successfully been flushed, a “would block” error means that the
current task is ready to receive a notification when flushing can make more
progress, and otherwise normal errors can happen as well.</p>
<p>Utilities for working with <code>AsyncWrite</code> values are provided by
<a href="trait.AsyncWriteExt.html"><code>AsyncWriteExt</code></a>.</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/tokio/io/async_write.rs.html#58-62">source</a><h4 class="code-header">fn <a href="#tymethod.poll_write" class="fnname">poll_write</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;buf: &amp;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>&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>. If successful,
then it must be guaranteed that <code>n &lt;= buf.len()</code>. A return value of <code>0</code>
typically means that the underlying object is no longer able to accept
bytes and will likely not be able to in the future as well, or that the
buffer provided is empty.</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()</code>) to receive a notification when the object becomes
writable or is closed.</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/tokio/io/async_write.rs.html#73">source</a><h4 class="code-header">fn <a href="#tymethod.poll_flush" class="fnname">poll_flush</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>&gt;&gt;</h4></section></summary><div class="docblock"><p>Attempts 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()</code>) to receive a notification when the object can make
progress towards flushing.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="tymethod.poll_shutdown" class="method has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#133">source</a><h4 class="code-header">fn <a href="#tymethod.poll_shutdown" class="fnname">poll_shutdown</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>&gt;&gt;</h4></section></summary><div class="docblock"><p>Initiates or attempts to shut down this writer, returning success when
the I/O connection has completely shut down.</p>
<p>This method is intended to be used for asynchronous shutdown of I/O
connections. For example this is suitable for implementing shutdown of a
TLS connection or calling <code>TcpStream::shutdown</code> on a proxied connection.
Protocols sometimes need to flush out final pieces of data or otherwise
perform a graceful shutdown handshake, reading/writing more data as
appropriate. This method is the hook for such protocols to implement the
graceful shutdown logic.</p>
<p>This <code>shutdown</code> method is required by implementers of the
<code>AsyncWrite</code> trait. Wrappers typically just want to proxy this call
through to the wrapped type, and base types will typically implement
shutdown logic here or just return <code>Ok(().into())</code>. Note that if you’re
wrapping an underlying <code>AsyncWrite</code> a call to <code>shutdown</code> implies that
transitively the entire stream has been shut down. After your wrapper’s
shutdown logic has been executed you should shut down the underlying
stream.</p>
<p>Invocation of a <code>shutdown</code> implies an invocation of <code>flush</code>. Once this
method returns <code>Ready</code> it implies that a flush successfully happened
before the shutdown happened. That is, callers don’t need to call
<code>flush</code> before calling <code>shutdown</code>. They can rely that by calling
<code>shutdown</code> any pending buffered data will be written out.</p>
<h5 id="return-value"><a href="#return-value">Return value</a></h5>
<p>This function returns a <code>Poll&lt;io::Result&lt;()&gt;&gt;</code> classified as such:</p>
<ul>
<li>
<p><code>Poll::Ready(Ok(()))</code> - indicates that the connection was
successfully shut down and is now safe to deallocate/drop/close
resources associated with it. This method means that the current task
will no longer receive any notifications due to this method and the
I/O object itself is likely no longer usable.</p>
</li>
<li>
<p><code>Poll::Pending</code> - indicates that shutdown is initiated but could
not complete just yet. This may mean that more I/O needs to happen to
continue this shutdown operation. The current task is scheduled to
receive a notification when it’s otherwise ready to continue the
shutdown operation. When woken up this method should be called again.</p>
</li>
<li>
<p><code>Poll::Ready(Err(e))</code> - indicates a fatal error has happened with shutdown,
indicating that the shutdown operation did not complete successfully.
This typically means that the I/O object is no longer usable.</p>
</li>
</ul>
<h5 id="errors"><a href="#errors">Errors</a></h5>
<p>This function can return normal I/O errors through <code>Err</code>, described
above. Additionally this method may also render the underlying
<code>Write::write</code> method no longer usable (e.g. will return errors in the
future). It’s recommended that once <code>shutdown</code> is called the
<code>write</code> method is no longer called.</p>
<h5 id="panics"><a href="#panics">Panics</a></h5>
<p>This function will panic if not called within the context of a future’s
task.</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/tokio/io/async_write.rs.html#158-168">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: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;bufs: &amp;[<a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.IoSlice.html" title="struct std::io::IoSlice">IoSlice</a>&lt;'_&gt;]<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>&gt;&gt;</h4></section></summary><div class="docblock"><p>Like <a href="trait.AsyncWrite.html#tymethod.poll_write"><code>poll_write</code></a>, except that it writes from a slice of buffers.</p>
<p>Data is copied from each buffer in order, with the final buffer
read from possibly being only partially consumed. This method must
behave as a call to <a href="https://doc.rust-lang.org/nightly/core/macro.write.html" title="write"><code>write</code></a> with the buffers concatenated would.</p>
<p>The default implementation calls <a href="trait.AsyncWrite.html#tymethod.poll_write"><code>poll_write</code></a> with either the first nonempty
buffer provided, or an empty one if none exists.</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()</code>) to receive a notification when the object becomes
writable or is closed.</p>
<h5 id="note"><a href="#note">Note</a></h5>
<p>This should be implemented as a single “atomic” write action. If any
data has been partially written, it is wrong to return an error or
pending.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.is_write_vectored" class="method has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#180-182">source</a><h4 class="code-header">fn <a href="#method.is_write_vectored" class="fnname">is_write_vectored</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Determines if this writer has an efficient <a href="trait.AsyncWrite.html#method.poll_write_vectored"><code>poll_write_vectored</code></a>
implementation.</p>
<p>If a writer does not override the default <a href="trait.AsyncWrite.html#method.poll_write_vectored"><code>poll_write_vectored</code></a>
implementation, code using it may want to avoid the method all together
and coalesce writes into a single buffer for higher performance.</p>
<p>The default implementation returns <code>false</code>.</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-Box%3CT%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#217-219">source</a><a href="#impl-AsyncWrite-for-Box%3CT%3E" class="anchor"></a><h3 class="code-header">impl&lt;T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite">AsyncWrite</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>&gt; <a class="trait" href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite">AsyncWrite</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;T&gt;</h3></section></summary><div class="impl-items"><section id="method.poll_write" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#218">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: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;buf: &amp;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;&gt;</h4></section><section id="method.poll_write_vectored-1" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#218">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: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;bufs: &amp;[<a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.IoSlice.html" title="struct std::io::IoSlice">IoSlice</a>&lt;'_&gt;]<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;&gt;</h4></section><section id="method.is_write_vectored-1" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#218">source</a><a href="#method.is_write_vectored-1" class="anchor"></a><h4 class="code-header">fn <a href="#method.is_write_vectored" class="fnname">is_write_vectored</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section><section id="method.poll_flush" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#218">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>(self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;, cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;&gt;</h4></section><section id="method.poll_shutdown" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#218">source</a><a href="#method.poll_shutdown" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.poll_shutdown" class="fnname">poll_shutdown</a>(self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;, cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;&gt;</h4></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-AsyncWrite-for-%26mut%20T" class="impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#221-223">source</a><a href="#impl-AsyncWrite-for-%26mut%20T" class="anchor"></a><h3 class="code-header">impl&lt;T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite">AsyncWrite</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>&gt; <a class="trait" href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite">AsyncWrite</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T</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/tokio/io/async_write.rs.html#222">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: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;buf: &amp;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;&gt;</h4></section><section id="method.poll_write_vectored-2" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#222">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: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;bufs: &amp;[<a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.IoSlice.html" title="struct std::io::IoSlice">IoSlice</a>&lt;'_&gt;]<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;&gt;</h4></section><section id="method.is_write_vectored-2" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#222">source</a><a href="#method.is_write_vectored-2" class="anchor"></a><h4 class="code-header">fn <a href="#method.is_write_vectored" class="fnname">is_write_vectored</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section><section id="method.poll_flush-1" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#222">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>(self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;, cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;&gt;</h4></section><section id="method.poll_shutdown-1" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#222">source</a><a href="#method.poll_shutdown-1" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.poll_shutdown" class="fnname">poll_shutdown</a>(self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;, cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&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/tokio/io/async_write.rs.html#225-257">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 tokio::io::AsyncWrite">AsyncWrite</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;P&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.DerefMut.html" title="trait core::ops::deref::DerefMut">DerefMut</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;P::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target" title="type core::ops::deref::Deref::Target">Target</a>: <a class="trait" href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite">AsyncWrite</a>,</span></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/tokio/io/async_write.rs.html#230-236">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: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;buf: &amp;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;&gt;</h4></section><section id="method.poll_write_vectored-3" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#238-244">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: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;bufs: &amp;[<a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.IoSlice.html" title="struct std::io::IoSlice">IoSlice</a>&lt;'_&gt;]<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;&gt;</h4></section><section id="method.is_write_vectored-3" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#246-248">source</a><a href="#method.is_write_vectored-3" class="anchor"></a><h4 class="code-header">fn <a href="#method.is_write_vectored" class="fnname">is_write_vectored</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section><section id="method.poll_flush-2" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#250-252">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>(self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;, cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;&gt;</h4></section><section id="method.poll_shutdown-2" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#254-256">source</a><a href="#method.poll_shutdown-2" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.poll_shutdown" class="fnname">poll_shutdown</a>(self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;, cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;&gt;</h4></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-AsyncWrite-for-Vec%3Cu8%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#259-288">source</a><a href="#impl-AsyncWrite-for-Vec%3Cu8%3E" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite">AsyncWrite</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>&gt;</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/tokio/io/async_write.rs.html#260-267">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: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;_cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;buf: &amp;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;&gt;</h4></section><section id="method.poll_write_vectored-4" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#269-275">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: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;_: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;bufs: &amp;[<a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.IoSlice.html" title="struct std::io::IoSlice">IoSlice</a>&lt;'_&gt;]<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;&gt;</h4></section><section id="method.is_write_vectored-4" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#277-279">source</a><a href="#method.is_write_vectored-4" class="anchor"></a><h4 class="code-header">fn <a href="#method.is_write_vectored" class="fnname">is_write_vectored</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section><section id="method.poll_flush-3" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#281-283">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>(self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;, _cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;&gt;</h4></section><section id="method.poll_shutdown-3" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#285-287">source</a><a href="#method.poll_shutdown-3" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.poll_shutdown" class="fnname">poll_shutdown</a>(self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;, _cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;&gt;</h4></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-AsyncWrite-for-Cursor%3C%26mut%20%5Bu8%5D%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#290-318">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 tokio::io::AsyncWrite">AsyncWrite</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/cursor/struct.Cursor.html" title="struct std::io::cursor::Cursor">Cursor</a>&lt;&amp;mut [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]&gt;</h3></section></summary><div class="impl-items"><section id="method.poll_write-4" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#291-297">source</a><a href="#method.poll_write-4" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.poll_write" class="fnname">poll_write</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;_: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;buf: &amp;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;&gt;</h4></section><section id="method.poll_write_vectored-5" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#299-305">source</a><a href="#method.poll_write_vectored-5" 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: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;_: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;bufs: &amp;[<a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.IoSlice.html" title="struct std::io::IoSlice">IoSlice</a>&lt;'_&gt;]<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;&gt;</h4></section><section id="method.is_write_vectored-5" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#307-309">source</a><a href="#method.is_write_vectored-5" class="anchor"></a><h4 class="code-header">fn <a href="#method.is_write_vectored" class="fnname">is_write_vectored</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section><section id="method.poll_flush-4" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#311-313">source</a><a href="#method.poll_flush-4" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.poll_flush" class="fnname">poll_flush</a>(self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;, _: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;&gt;</h4></section><section id="method.poll_shutdown-4" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#315-317">source</a><a href="#method.poll_shutdown-4" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.poll_shutdown" class="fnname">poll_shutdown</a>(self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;, cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;&gt;</h4></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-AsyncWrite-for-Cursor%3C%26mut%20Vec%3Cu8%3E%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#320-348">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 tokio::io::AsyncWrite">AsyncWrite</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/cursor/struct.Cursor.html" title="struct std::io::cursor::Cursor">Cursor</a>&lt;&amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>&gt;&gt;</h3></section></summary><div class="impl-items"><section id="method.poll_write-5" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#321-327">source</a><a href="#method.poll_write-5" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.poll_write" class="fnname">poll_write</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;_: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;buf: &amp;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;&gt;</h4></section><section id="method.poll_write_vectored-6" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#329-335">source</a><a href="#method.poll_write_vectored-6" 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: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;_: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;bufs: &amp;[<a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.IoSlice.html" title="struct std::io::IoSlice">IoSlice</a>&lt;'_&gt;]<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;&gt;</h4></section><section id="method.is_write_vectored-6" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#337-339">source</a><a href="#method.is_write_vectored-6" class="anchor"></a><h4 class="code-header">fn <a href="#method.is_write_vectored" class="fnname">is_write_vectored</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section><section id="method.poll_flush-5" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#341-343">source</a><a href="#method.poll_flush-5" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.poll_flush" class="fnname">poll_flush</a>(self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;, _: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;&gt;</h4></section><section id="method.poll_shutdown-5" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#345-347">source</a><a href="#method.poll_shutdown-5" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.poll_shutdown" class="fnname">poll_shutdown</a>(self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;, cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;&gt;</h4></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-AsyncWrite-for-Cursor%3CVec%3Cu8%3E%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#350-378">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 tokio::io::AsyncWrite">AsyncWrite</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/cursor/struct.Cursor.html" title="struct std::io::cursor::Cursor">Cursor</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>&gt;&gt;</h3></section></summary><div class="impl-items"><section id="method.poll_write-6" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#351-357">source</a><a href="#method.poll_write-6" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.poll_write" class="fnname">poll_write</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;_: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;buf: &amp;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;&gt;</h4></section><section id="method.poll_write_vectored-7" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#359-365">source</a><a href="#method.poll_write_vectored-7" 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: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;_: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;bufs: &amp;[<a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.IoSlice.html" title="struct std::io::IoSlice">IoSlice</a>&lt;'_&gt;]<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;&gt;</h4></section><section id="method.is_write_vectored-7" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#367-369">source</a><a href="#method.is_write_vectored-7" class="anchor"></a><h4 class="code-header">fn <a href="#method.is_write_vectored" class="fnname">is_write_vectored</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section><section id="method.poll_flush-6" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#371-373">source</a><a href="#method.poll_flush-6" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.poll_flush" class="fnname">poll_flush</a>(self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;, _: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;&gt;</h4></section><section id="method.poll_shutdown-6" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#375-377">source</a><a href="#method.poll_shutdown-6" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.poll_shutdown" class="fnname">poll_shutdown</a>(self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;, cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;&gt;</h4></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-AsyncWrite-for-Cursor%3CBox%3C%5Bu8%5D%3E%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#380-408">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 tokio::io::AsyncWrite">AsyncWrite</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/cursor/struct.Cursor.html" title="struct std::io::cursor::Cursor">Cursor</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]&gt;&gt;</h3></section></summary><div class="impl-items"><section id="method.poll_write-7" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#381-387">source</a><a href="#method.poll_write-7" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.poll_write" class="fnname">poll_write</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;_: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;buf: &amp;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;&gt;</h4></section><section id="method.poll_write_vectored-8" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#389-395">source</a><a href="#method.poll_write_vectored-8" 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: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;_: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;bufs: &amp;[<a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.IoSlice.html" title="struct std::io::IoSlice">IoSlice</a>&lt;'_&gt;]<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;&gt;</h4></section><section id="method.is_write_vectored-8" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#397-399">source</a><a href="#method.is_write_vectored-8" class="anchor"></a><h4 class="code-header">fn <a href="#method.is_write_vectored" class="fnname">is_write_vectored</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section><section id="method.poll_flush-7" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#401-403">source</a><a href="#method.poll_flush-7" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.poll_flush" class="fnname">poll_flush</a>(self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;, _: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;&gt;</h4></section><section id="method.poll_shutdown-7" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/async_write.rs.html#405-407">source</a><a href="#method.poll_shutdown-7" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.poll_shutdown" class="fnname">poll_shutdown</a>(self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;, cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&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-TcpStream" class="impl has-srclink"><a class="srclink rightside" href="../../src/tokio/net/tcp/stream.rs.html#1331-1362">source</a><a href="#impl-AsyncWrite-for-TcpStream" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite">AsyncWrite</a> for <a class="struct" href="../net/struct.TcpStream.html" title="struct tokio::net::TcpStream">TcpStream</a></h3></section><section id="impl-AsyncWrite-for-UnixStream" class="impl has-srclink"><a class="srclink rightside" href="../../src/tokio/net/unix/stream.rs.html#965-994">source</a><a href="#impl-AsyncWrite-for-UnixStream" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite">AsyncWrite</a> for <a class="struct" href="../net/struct.UnixStream.html" title="struct tokio::net::UnixStream">UnixStream</a></h3></section><section id="impl-AsyncWrite-for-OwnedWriteHalf" class="impl has-srclink"><a class="srclink rightside" href="../../src/tokio/net/tcp/split_owned.rs.html#460-495">source</a><a href="#impl-AsyncWrite-for-OwnedWriteHalf" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite">AsyncWrite</a> for tokio::net::tcp::<a class="struct" href="../net/tcp/struct.OwnedWriteHalf.html" title="struct tokio::net::tcp::OwnedWriteHalf">OwnedWriteHalf</a></h3></section><section id="impl-AsyncWrite-for-WriteHalf%3C%27_%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/tokio/net/tcp/split.rs.html#380-411">source</a><a href="#impl-AsyncWrite-for-WriteHalf%3C%27_%3E" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite">AsyncWrite</a> for tokio::net::tcp::<a class="struct" href="../net/tcp/struct.WriteHalf.html" title="struct tokio::net::tcp::WriteHalf">WriteHalf</a>&lt;'_&gt;</h3></section><section id="impl-AsyncWrite-for-Sender" class="impl has-srclink"><a class="srclink rightside" href="../../src/tokio/net/unix/pipe.rs.html#631-659">source</a><a href="#impl-AsyncWrite-for-Sender" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite">AsyncWrite</a> for <a class="struct" href="../net/unix/pipe/struct.Sender.html" title="struct tokio::net::unix::pipe::Sender">Sender</a></h3></section><section id="impl-AsyncWrite-for-OwnedWriteHalf-1" class="impl has-srclink"><a class="srclink rightside" href="../../src/tokio/net/unix/split_owned.rs.html#372-407">source</a><a href="#impl-AsyncWrite-for-OwnedWriteHalf-1" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite">AsyncWrite</a> for tokio::net::unix::<a class="struct" href="../net/unix/struct.OwnedWriteHalf.html" title="struct tokio::net::unix::OwnedWriteHalf">OwnedWriteHalf</a></h3></section><section id="impl-AsyncWrite-for-WriteHalf%3C%27_%3E-1" class="impl has-srclink"><a class="srclink rightside" href="../../src/tokio/net/unix/split.rs.html#291-319">source</a><a href="#impl-AsyncWrite-for-WriteHalf%3C%27_%3E-1" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite">AsyncWrite</a> for tokio::net::unix::<a class="struct" href="../net/unix/struct.WriteHalf.html" title="struct tokio::net::unix::WriteHalf">WriteHalf</a>&lt;'_&gt;</h3></section><section id="impl-AsyncWrite-for-DuplexStream" class="impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/util/mem.rs.html#117-142">source</a><a href="#impl-AsyncWrite-for-DuplexStream" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite">AsyncWrite</a> for <a class="struct" href="struct.DuplexStream.html" title="struct tokio::io::DuplexStream">DuplexStream</a></h3></section><section id="impl-AsyncWrite-for-Sink" class="impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/util/sink.rs.html#52-71">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 tokio::io::AsyncWrite">AsyncWrite</a> for <a class="struct" href="struct.Sink.html" title="struct tokio::io::Sink">Sink</a></h3></section><section id="impl-AsyncWrite-for-Stderr" class="impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/stderr.rs.html#117-136">source</a><a href="#impl-AsyncWrite-for-Stderr" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite">AsyncWrite</a> for <a class="struct" href="struct.Stderr.html" title="struct tokio::io::Stderr">Stderr</a></h3></section><section id="impl-AsyncWrite-for-Stdout" class="impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/stdout.rs.html#116-135">source</a><a href="#impl-AsyncWrite-for-Stdout" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite">AsyncWrite</a> for <a class="struct" href="struct.Stdout.html" title="struct tokio::io::Stdout">Stdout</a></h3></section><section id="impl-AsyncWrite-for-BufReader%3CR%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/util/buf_reader.rs.html#261-289">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.AsyncRead.html" title="trait tokio::io::AsyncRead">AsyncRead</a> + <a class="trait" href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite">AsyncWrite</a>&gt; <a class="trait" href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite">AsyncWrite</a> for <a class="struct" href="struct.BufReader.html" title="struct tokio::io::BufReader">BufReader</a>&lt;R&gt;</h3></section><section id="impl-AsyncWrite-for-BufStream%3CRW%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/util/buf_stream.rs.html#121-149">source</a><a href="#impl-AsyncWrite-for-BufStream%3CRW%3E" class="anchor"></a><h3 class="code-header">impl&lt;RW:&nbsp;<a class="trait" href="trait.AsyncRead.html" title="trait tokio::io::AsyncRead">AsyncRead</a> + <a class="trait" href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite">AsyncWrite</a>&gt; <a class="trait" href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite">AsyncWrite</a> for <a class="struct" href="struct.BufStream.html" title="struct tokio::io::BufStream">BufStream</a>&lt;RW&gt;</h3></section><section id="impl-AsyncWrite-for-WriteHalf%3CT%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/split.rs.html#115-134">source</a><a href="#impl-AsyncWrite-for-WriteHalf%3CT%3E" class="anchor"></a><h3 class="code-header">impl&lt;T:&nbsp;<a class="trait" href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite">AsyncWrite</a>&gt; <a class="trait" href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite">AsyncWrite</a> for tokio::io::<a class="struct" href="struct.WriteHalf.html" title="struct tokio::io::WriteHalf">WriteHalf</a>&lt;T&gt;</h3></section><section id="impl-AsyncWrite-for-BufWriter%3CW%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/tokio/io/util/buf_writer.rs.html#118-211">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 tokio::io::AsyncWrite">AsyncWrite</a>&gt; <a class="trait" href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite">AsyncWrite</a> for <a class="struct" href="struct.BufWriter.html" title="struct tokio::io::BufWriter">BufWriter</a>&lt;W&gt;</h3></section></div><script src="../../implementors/tokio/io/async_write/trait.AsyncWrite.js" data-ignore-extern-crates="alloc,core,std" async></script></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="tokio" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.66.0-nightly (5c8bff74b 2022-10-21)" ></div></body></html>