Files
GopherGate/target/doc/tokio/net/struct.UnixStream.html
2026-02-26 12:00:21 -05:00

725 lines
151 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="A structure representing a connected Unix socket."><title>UnixStream in tokio::net - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="tokio" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">UnixStream</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tokio/index.html">tokio</a><span class="version">1.49.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Unix<wbr>Stream</a></h2><h3><a href="#implementations">Methods</a></h3><ul class="block method"><li><a href="#method.async_io" title="async_io">async_io</a></li><li><a href="#method.connect" title="connect">connect</a></li><li><a href="#method.from_std" title="from_std">from_std</a></li><li><a href="#method.into_split" title="into_split">into_split</a></li><li><a href="#method.into_std" title="into_std">into_std</a></li><li><a href="#method.local_addr" title="local_addr">local_addr</a></li><li><a href="#method.pair" title="pair">pair</a></li><li><a href="#method.peer_addr" title="peer_addr">peer_addr</a></li><li><a href="#method.peer_cred" title="peer_cred">peer_cred</a></li><li><a href="#method.poll_read_ready" title="poll_read_ready">poll_read_ready</a></li><li><a href="#method.poll_write_ready" title="poll_write_ready">poll_write_ready</a></li><li><a href="#method.readable" title="readable">readable</a></li><li><a href="#method.ready" title="ready">ready</a></li><li><a href="#method.split" title="split">split</a></li><li><a href="#method.take_error" title="take_error">take_error</a></li><li><a href="#method.try_io" title="try_io">try_io</a></li><li><a href="#method.try_read" title="try_read">try_read</a></li><li><a href="#method.try_read_buf" title="try_read_buf">try_read_buf</a></li><li><a href="#method.try_read_vectored" title="try_read_vectored">try_read_vectored</a></li><li><a href="#method.try_write" title="try_write">try_write</a></li><li><a href="#method.try_write_vectored" title="try_write_vectored">try_write_vectored</a></li><li><a href="#method.writable" title="writable">writable</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-AsFd-for-UnixStream" title="AsFd">AsFd</a></li><li><a href="#impl-AsRawFd-for-UnixStream" title="AsRawFd">AsRawFd</a></li><li><a href="#impl-AsRef%3CUnixStream%3E-for-OwnedReadHalf" title="AsRef&#60;UnixStream&#62;">AsRef&#60;UnixStream&#62;</a></li><li><a href="#impl-AsRef%3CUnixStream%3E-for-OwnedWriteHalf" title="AsRef&#60;UnixStream&#62;">AsRef&#60;UnixStream&#62;</a></li><li><a href="#impl-AsRef%3CUnixStream%3E-for-ReadHalf%3C'_%3E" title="AsRef&#60;UnixStream&#62;">AsRef&#60;UnixStream&#62;</a></li><li><a href="#impl-AsRef%3CUnixStream%3E-for-UnixStream" title="AsRef&#60;UnixStream&#62;">AsRef&#60;UnixStream&#62;</a></li><li><a href="#impl-AsRef%3CUnixStream%3E-for-WriteHalf%3C'_%3E" title="AsRef&#60;UnixStream&#62;">AsRef&#60;UnixStream&#62;</a></li><li><a href="#impl-AsyncRead-for-UnixStream" title="AsyncRead">AsyncRead</a></li><li><a href="#impl-AsyncWrite-for-UnixStream" title="AsyncWrite">AsyncWrite</a></li><li><a href="#impl-Debug-for-UnixStream" title="Debug">Debug</a></li><li><a href="#impl-TryFrom%3CUnixStream%3E-for-UnixStream" title="TryFrom&#60;UnixStream&#62;">TryFrom&#60;UnixStream&#62;</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-Freeze-for-UnixStream" title="!Freeze">!Freeze</a></li><li><a href="#impl-RefUnwindSafe-for-UnixStream" title="RefUnwindSafe">RefUnwindSafe</a></li><li><a href="#impl-Send-for-UnixStream" title="Send">Send</a></li><li><a href="#impl-Sync-for-UnixStream" title="Sync">Sync</a></li><li><a href="#impl-Unpin-for-UnixStream" title="Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe-for-UnixStream" title="UnwindSafe">UnwindSafe</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block blanket-implementation"><li><a href="#impl-Any-for-T" title="Any">Any</a></li><li><a href="#impl-AsyncReadExt-for-R" title="AsyncReadExt">AsyncReadExt</a></li><li><a href="#impl-AsyncWriteExt-for-W" title="AsyncWriteExt">AsyncWriteExt</a></li><li><a href="#impl-Borrow%3CT%3E-for-T" title="Borrow&#60;T&#62;">Borrow&#60;T&#62;</a></li><li><a href="#impl-BorrowMut%3CT%3E-for-T" title="BorrowMut&#60;T&#62;">BorrowMut&#60;T&#62;</a></li><li><a href="#impl-From%3CT%3E-for-T" title="From&#60;T&#62;">From&#60;T&#62;</a></li><li><a href="#impl-Into%3CU%3E-for-T" title="Into&#60;U&#62;">Into&#60;U&#62;</a></li><li><a href="#impl-TryFrom%3CU%3E-for-T" title="TryFrom&#60;U&#62;">TryFrom&#60;U&#62;</a></li><li><a href="#impl-TryInto%3CU%3E-for-T" title="TryInto&#60;U&#62;">TryInto&#60;U&#62;</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>net</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">tokio</a>::<wbr><a href="index.html">net</a></div><h1>Struct <span class="struct">Unix<wbr>Stream</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/tokio/net/unix/stream.rs.html#43-45">Source</a> </span></div><pre class="rust item-decl"><code>pub struct UnixStream { <span class="comment">/* private fields */</span> }</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A structure representing a connected Unix socket.</p>
<p>This socket can be connected directly with <a href="struct.UnixStream.html#method.connect" title="associated function tokio::net::UnixStream::connect"><code>UnixStream::connect</code></a> or accepted
from a listener with <a href="struct.UnixListener.html#method.accept" title="method tokio::net::UnixListener::accept"><code>UnixListener::accept</code></a>. Additionally, a pair of
anonymous Unix sockets can be created with <code>UnixStream::pair</code>.</p>
<p>To shut down the stream in the write direction, you can call the
<a href="../io/trait.AsyncWriteExt.html#method.shutdown" title="method tokio::io::AsyncWriteExt::shutdown"><code>shutdown()</code></a> method. This will cause the other peer to receive a read of
length 0, indicating that no more data will be sent. This only closes
the stream in one direction.</p>
</div></details><h2 id="implementations" class="section-header">Implementations<a href="#implementations" class="anchor">§</a></h2><div id="implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-UnixStream" class="impl"><a class="src rightside" href="../../src/tokio/net/unix/stream.rs.html#48-985">Source</a><a href="#impl-UnixStream" class="anchor">§</a><h3 class="code-header">impl <a class="struct" href="struct.UnixStream.html" title="struct tokio::net::UnixStream">UnixStream</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.connect" class="method"><a class="src rightside" href="../../src/tokio/net/unix/stream.rs.html#72-99">Source</a><h4 class="code-header">pub async fn <a href="#method.connect" class="fn">connect</a>&lt;P&gt;(path: P) -&gt; <a class="type" href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="struct" href="struct.UnixStream.html" title="struct tokio::net::UnixStream">UnixStream</a>&gt;<div class="where">where
P: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.93.1/std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;,</div></h4></section></summary><div class="docblock"><p>Connects to the socket named by <code>path</code>.</p>
<p>This function will create a new Unix socket and connect to the path
specified, associating the returned stream with the default event loops
handle.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.ready" class="method"><a class="src rightside" href="../../src/tokio/net/unix/stream.rs.html#176-179">Source</a><h4 class="code-header">pub async fn <a href="#method.ready" class="fn">ready</a>(&amp;self, interest: <a class="struct" href="../io/struct.Interest.html" title="struct tokio::io::Interest">Interest</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="struct" href="../io/struct.Ready.html" title="struct tokio::io::Ready">Ready</a>&gt;</h4></section></summary><div class="docblock"><p>Waits for any of the requested ready states.</p>
<p>This function is usually paired with <code>try_read()</code> or <code>try_write()</code>. It
can be used to concurrently read / write to the same socket on a single
task without splitting the socket.</p>
<p>The function may complete without the socket being ready. This is a
false-positive and attempting an operation will return with
<code>io::ErrorKind::WouldBlock</code>. The function can also return with an empty
<a href="../io/struct.Ready.html" title="struct tokio::io::Ready"><code>Ready</code></a> set, so you should always check the returned value and possibly
wait again if the requested states are not set.</p>
<h5 id="cancel-safety"><a class="doc-anchor" href="#cancel-safety">§</a>Cancel safety</h5>
<p>This method is cancel safe. Once a readiness event occurs, the method
will continue to return immediately until the readiness event is
consumed by an attempt to read or write that fails with <code>WouldBlock</code> or
<code>Poll::Pending</code>.</p>
<h5 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h5>
<p>Concurrently read and write to the stream on the same task without
splitting.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::io::Interest;
<span class="kw">use </span>tokio::net::UnixStream;
<span class="kw">use </span>std::error::Error;
<span class="kw">use </span>std::io;
<span class="attr">#[tokio::main]
</span><span class="kw">async fn </span>main() -&gt; <span class="prelude-ty">Result</span>&lt;(), Box&lt;<span class="kw">dyn </span>Error&gt;&gt; {
<span class="kw">let </span>dir = tempfile::tempdir().unwrap();
<span class="kw">let </span>bind_path = dir.path().join(<span class="string">"bind_path"</span>);
<span class="kw">let </span>stream = UnixStream::connect(bind_path).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="kw">loop </span>{
<span class="kw">let </span>ready = stream.ready(Interest::READABLE | Interest::WRITABLE).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="kw">if </span>ready.is_readable() {
<span class="kw">let </span><span class="kw-2">mut </span>data = <span class="macro">vec!</span>[<span class="number">0</span>; <span class="number">1024</span>];
<span class="comment">// Try to read data, this may still fail with `WouldBlock`
// if the readiness event is a false positive.
</span><span class="kw">match </span>stream.try_read(<span class="kw-2">&amp;mut </span>data) {
<span class="prelude-val">Ok</span>(n) =&gt; {
<span class="macro">println!</span>(<span class="string">"read {} bytes"</span>, n);
}
<span class="prelude-val">Err</span>(<span class="kw-2">ref </span>e) <span class="kw">if </span>e.kind() == io::ErrorKind::WouldBlock =&gt; {
<span class="kw">continue</span>;
}
<span class="prelude-val">Err</span>(e) =&gt; {
<span class="kw">return </span><span class="prelude-val">Err</span>(e.into());
}
}
}
<span class="kw">if </span>ready.is_writable() {
<span class="comment">// Try to write data, this may still fail with `WouldBlock`
// if the readiness event is a false positive.
</span><span class="kw">match </span>stream.try_write(<span class="string">b"hello world"</span>) {
<span class="prelude-val">Ok</span>(n) =&gt; {
<span class="macro">println!</span>(<span class="string">"write {} bytes"</span>, n);
}
<span class="prelude-val">Err</span>(<span class="kw-2">ref </span>e) <span class="kw">if </span>e.kind() == io::ErrorKind::WouldBlock =&gt; {
<span class="kw">continue</span>;
}
<span class="prelude-val">Err</span>(e) =&gt; {
<span class="kw">return </span><span class="prelude-val">Err</span>(e.into());
}
}
}
}
}</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.readable" class="method"><a class="src rightside" href="../../src/tokio/net/unix/stream.rs.html#233-236">Source</a><h4 class="code-header">pub async fn <a href="#method.readable" class="fn">readable</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>&gt;</h4></section></summary><div class="docblock"><p>Waits for the socket to become readable.</p>
<p>This function is equivalent to <code>ready(Interest::READABLE)</code> and is usually
paired with <code>try_read()</code>.</p>
<h5 id="cancel-safety-1"><a class="doc-anchor" href="#cancel-safety-1">§</a>Cancel safety</h5>
<p>This method is cancel safe. Once a readiness event occurs, the method
will continue to return immediately until the readiness event is
consumed by an attempt to read that fails with <code>WouldBlock</code> or
<code>Poll::Pending</code>.</p>
<h5 id="examples-1"><a class="doc-anchor" href="#examples-1">§</a>Examples</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::net::UnixStream;
<span class="kw">use </span>std::error::Error;
<span class="kw">use </span>std::io;
<span class="attr">#[tokio::main]
</span><span class="kw">async fn </span>main() -&gt; <span class="prelude-ty">Result</span>&lt;(), Box&lt;<span class="kw">dyn </span>Error&gt;&gt; {
<span class="comment">// Connect to a peer
</span><span class="kw">let </span>dir = tempfile::tempdir().unwrap();
<span class="kw">let </span>bind_path = dir.path().join(<span class="string">"bind_path"</span>);
<span class="kw">let </span>stream = UnixStream::connect(bind_path).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="kw">let </span><span class="kw-2">mut </span>msg = <span class="macro">vec!</span>[<span class="number">0</span>; <span class="number">1024</span>];
<span class="kw">loop </span>{
<span class="comment">// Wait for the socket to be readable
</span>stream.readable().<span class="kw">await</span><span class="question-mark">?</span>;
<span class="comment">// Try to read data, this may still fail with `WouldBlock`
// if the readiness event is a false positive.
</span><span class="kw">match </span>stream.try_read(<span class="kw-2">&amp;mut </span>msg) {
<span class="prelude-val">Ok</span>(n) =&gt; {
msg.truncate(n);
<span class="kw">break</span>;
}
<span class="prelude-val">Err</span>(<span class="kw-2">ref </span>e) <span class="kw">if </span>e.kind() == io::ErrorKind::WouldBlock =&gt; {
<span class="kw">continue</span>;
}
<span class="prelude-val">Err</span>(e) =&gt; {
<span class="kw">return </span><span class="prelude-val">Err</span>(e.into());
}
}
}
<span class="macro">println!</span>(<span class="string">"GOT = {:?}"</span>, msg);
<span class="prelude-val">Ok</span>(())
}</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.poll_read_ready" class="method"><a class="src rightside" href="../../src/tokio/net/unix/stream.rs.html#267-269">Source</a><h4 class="code-header">pub fn <a href="#method.poll_read_ready" class="fn">poll_read_ready</a>(&amp;self, cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.93.1/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/1.93.1/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>&gt;&gt;</h4></section></summary><div class="docblock"><p>Polls for read readiness.</p>
<p>If the unix stream is not currently ready for reading, this method will
store a clone of the <code>Waker</code> from the provided <code>Context</code>. When the unix
stream becomes ready for reading, <code>Waker::wake</code> will be called on the
waker.</p>
<p>Note that on multiple calls to <code>poll_read_ready</code> or <code>poll_read</code>, only
the <code>Waker</code> from the <code>Context</code> passed to the most recent call is
scheduled to receive a wakeup. (However, <code>poll_write_ready</code> retains a
second, independent waker.)</p>
<p>This function is intended for cases where creating and pinning a future
via <a href="struct.UnixStream.html#method.readable" title="method tokio::net::UnixStream::readable"><code>readable</code></a> is not feasible. Where possible, using <a href="struct.UnixStream.html#method.readable" title="method tokio::net::UnixStream::readable"><code>readable</code></a> is
preferred, as this supports polling from multiple tasks at once.</p>
<h5 id="return-value"><a class="doc-anchor" href="#return-value">§</a>Return value</h5>
<p>The function returns:</p>
<ul>
<li><code>Poll::Pending</code> if the unix stream is not ready for reading.</li>
<li><code>Poll::Ready(Ok(()))</code> if the unix stream is ready for reading.</li>
<li><code>Poll::Ready(Err(e))</code> if an error is encountered.</li>
</ul>
<h5 id="errors"><a class="doc-anchor" href="#errors">§</a>Errors</h5>
<p>This function may encounter any standard I/O error except <code>WouldBlock</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.try_read" class="method"><a class="src rightside" href="../../src/tokio/net/unix/stream.rs.html#336-340">Source</a><h4 class="code-header">pub fn <a href="#method.try_read" class="fn">try_read</a>(&amp;self, buf: &amp;mut [<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>]) -&gt; <a class="type" href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>&gt;</h4></section></summary><div class="docblock"><p>Try to read data from the stream into the provided buffer, returning how
many bytes were read.</p>
<p>Receives any pending data from the socket but does not wait for new data
to arrive. On success, returns the number of bytes read. Because
<code>try_read()</code> is non-blocking, the buffer does not have to be stored by
the async task and can exist entirely on the stack.</p>
<p>Usually, <a href="struct.UnixStream.html#method.readable" title="method tokio::net::UnixStream::readable"><code>readable()</code></a> or <a href="struct.UnixStream.html#method.ready" title="method tokio::net::UnixStream::ready"><code>ready()</code></a> is used with this function.</p>
<h5 id="return"><a class="doc-anchor" href="#return">§</a>Return</h5>
<p>If data is successfully read, <code>Ok(n)</code> is returned, where <code>n</code> is the
number of bytes read. If <code>n</code> is <code>0</code>, then it can indicate one of two scenarios:</p>
<ol>
<li>The streams read half is closed and will no longer yield data.</li>
<li>The specified buffer was 0 bytes in length.</li>
</ol>
<p>If the stream is not ready to read data,
<code>Err(io::ErrorKind::WouldBlock)</code> is returned.</p>
<h5 id="examples-2"><a class="doc-anchor" href="#examples-2">§</a>Examples</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::net::UnixStream;
<span class="kw">use </span>std::error::Error;
<span class="kw">use </span>std::io;
<span class="attr">#[tokio::main]
</span><span class="kw">async fn </span>main() -&gt; <span class="prelude-ty">Result</span>&lt;(), Box&lt;<span class="kw">dyn </span>Error&gt;&gt; {
<span class="comment">// Connect to a peer
</span><span class="kw">let </span>dir = tempfile::tempdir().unwrap();
<span class="kw">let </span>bind_path = dir.path().join(<span class="string">"bind_path"</span>);
<span class="kw">let </span>stream = UnixStream::connect(bind_path).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="kw">loop </span>{
<span class="comment">// Wait for the socket to be readable
</span>stream.readable().<span class="kw">await</span><span class="question-mark">?</span>;
<span class="comment">// Creating the buffer **after** the `await` prevents it from
// being stored in the async task.
</span><span class="kw">let </span><span class="kw-2">mut </span>buf = [<span class="number">0</span>; <span class="number">4096</span>];
<span class="comment">// Try to read data, this may still fail with `WouldBlock`
// if the readiness event is a false positive.
</span><span class="kw">match </span>stream.try_read(<span class="kw-2">&amp;mut </span>buf) {
<span class="prelude-val">Ok</span>(<span class="number">0</span>) =&gt; <span class="kw">break</span>,
<span class="prelude-val">Ok</span>(n) =&gt; {
<span class="macro">println!</span>(<span class="string">"read {} bytes"</span>, n);
}
<span class="prelude-val">Err</span>(<span class="kw-2">ref </span>e) <span class="kw">if </span>e.kind() == io::ErrorKind::WouldBlock =&gt; {
<span class="kw">continue</span>;
}
<span class="prelude-val">Err</span>(e) =&gt; {
<span class="kw">return </span><span class="prelude-val">Err</span>(e.into());
}
}
}
<span class="prelude-val">Ok</span>(())
}</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.try_read_vectored" class="method"><a class="src rightside" href="../../src/tokio/net/unix/stream.rs.html#414-418">Source</a><h4 class="code-header">pub fn <a href="#method.try_read_vectored" class="fn">try_read_vectored</a>(&amp;self, bufs: &amp;mut [<a class="struct" href="https://doc.rust-lang.org/1.93.1/std/io/struct.IoSliceMut.html" title="struct std::io::IoSliceMut">IoSliceMut</a>&lt;'_&gt;]) -&gt; <a class="type" href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>&gt;</h4></section></summary><div class="docblock"><p>Tries to read data from the stream into the provided buffers, returning
how many bytes were read.</p>
<p>Data is copied to fill each buffer in order, with the final buffer
written to possibly being only partially filled. This method behaves
equivalently to a single call to <a href="struct.UnixStream.html#method.try_read" title="method tokio::net::UnixStream::try_read"><code>try_read()</code></a> with concatenated
buffers.</p>
<p>Receives any pending data from the socket but does not wait for new data
to arrive. On success, returns the number of bytes read. Because
<code>try_read_vectored()</code> is non-blocking, the buffer does not have to be
stored by the async task and can exist entirely on the stack.</p>
<p>Usually, <a href="struct.UnixStream.html#method.readable" title="method tokio::net::UnixStream::readable"><code>readable()</code></a> or <a href="struct.UnixStream.html#method.ready" title="method tokio::net::UnixStream::ready"><code>ready()</code></a> is used with this function.</p>
<h5 id="return-1"><a class="doc-anchor" href="#return-1">§</a>Return</h5>
<p>If data is successfully read, <code>Ok(n)</code> is returned, where <code>n</code> is the
number of bytes read. <code>Ok(0)</code> indicates the streams read half is closed
and will no longer yield data. If the stream is not ready to read data
<code>Err(io::ErrorKind::WouldBlock)</code> is returned.</p>
<h5 id="examples-3"><a class="doc-anchor" href="#examples-3">§</a>Examples</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::net::UnixStream;
<span class="kw">use </span>std::error::Error;
<span class="kw">use </span>std::io::{<span class="self">self</span>, IoSliceMut};
<span class="attr">#[tokio::main]
</span><span class="kw">async fn </span>main() -&gt; <span class="prelude-ty">Result</span>&lt;(), Box&lt;<span class="kw">dyn </span>Error&gt;&gt; {
<span class="comment">// Connect to a peer
</span><span class="kw">let </span>dir = tempfile::tempdir().unwrap();
<span class="kw">let </span>bind_path = dir.path().join(<span class="string">"bind_path"</span>);
<span class="kw">let </span>stream = UnixStream::connect(bind_path).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="kw">loop </span>{
<span class="comment">// Wait for the socket to be readable
</span>stream.readable().<span class="kw">await</span><span class="question-mark">?</span>;
<span class="comment">// Creating the buffer **after** the `await` prevents it from
// being stored in the async task.
</span><span class="kw">let </span><span class="kw-2">mut </span>buf_a = [<span class="number">0</span>; <span class="number">512</span>];
<span class="kw">let </span><span class="kw-2">mut </span>buf_b = [<span class="number">0</span>; <span class="number">1024</span>];
<span class="kw">let </span><span class="kw-2">mut </span>bufs = [
IoSliceMut::new(<span class="kw-2">&amp;mut </span>buf_a),
IoSliceMut::new(<span class="kw-2">&amp;mut </span>buf_b),
];
<span class="comment">// Try to read data, this may still fail with `WouldBlock`
// if the readiness event is a false positive.
</span><span class="kw">match </span>stream.try_read_vectored(<span class="kw-2">&amp;mut </span>bufs) {
<span class="prelude-val">Ok</span>(<span class="number">0</span>) =&gt; <span class="kw">break</span>,
<span class="prelude-val">Ok</span>(n) =&gt; {
<span class="macro">println!</span>(<span class="string">"read {} bytes"</span>, n);
}
<span class="prelude-val">Err</span>(<span class="kw-2">ref </span>e) <span class="kw">if </span>e.kind() == io::ErrorKind::WouldBlock =&gt; {
<span class="kw">continue</span>;
}
<span class="prelude-val">Err</span>(e) =&gt; {
<span class="kw">return </span><span class="prelude-val">Err</span>(e.into());
}
}
}
<span class="prelude-val">Ok</span>(())
}</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.try_read_buf" class="method"><a class="src rightside" href="../../src/tokio/net/unix/stream.rs.html#480-498">Source</a><h4 class="code-header">pub fn <a href="#method.try_read_buf" class="fn">try_read_buf</a>&lt;B: <a class="trait" href="../../bytes/buf/buf_mut/trait.BufMut.html" title="trait bytes::buf::buf_mut::BufMut">BufMut</a>&gt;(&amp;self, buf: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;mut B</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>&gt;</h4></section></summary><div class="docblock"><p>Tries to read data from the stream into the provided buffer, advancing the
buffers internal cursor, returning how many bytes were read.</p>
<p>Receives any pending data from the socket but does not wait for new data
to arrive. On success, returns the number of bytes read. Because
<code>try_read_buf()</code> is non-blocking, the buffer does not have to be stored by
the async task and can exist entirely on the stack.</p>
<p>Usually, <a href="struct.UnixStream.html#method.readable" title="method tokio::net::UnixStream::readable"><code>readable()</code></a> or <a href="struct.UnixStream.html#method.ready" title="method tokio::net::UnixStream::ready"><code>ready()</code></a> is used with this function.</p>
<h5 id="return-2"><a class="doc-anchor" href="#return-2">§</a>Return</h5>
<p>If data is successfully read, <code>Ok(n)</code> is returned, where <code>n</code> is the
number of bytes read. <code>Ok(0)</code> indicates the streams read half is closed
and will no longer yield data. If the stream is not ready to read data
<code>Err(io::ErrorKind::WouldBlock)</code> is returned.</p>
<h5 id="examples-4"><a class="doc-anchor" href="#examples-4">§</a>Examples</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::net::UnixStream;
<span class="kw">use </span>std::error::Error;
<span class="kw">use </span>std::io;
<span class="attr">#[tokio::main]
</span><span class="kw">async fn </span>main() -&gt; <span class="prelude-ty">Result</span>&lt;(), Box&lt;<span class="kw">dyn </span>Error&gt;&gt; {
<span class="comment">// Connect to a peer
</span><span class="kw">let </span>dir = tempfile::tempdir().unwrap();
<span class="kw">let </span>bind_path = dir.path().join(<span class="string">"bind_path"</span>);
<span class="kw">let </span>stream = UnixStream::connect(bind_path).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="kw">loop </span>{
<span class="comment">// Wait for the socket to be readable
</span>stream.readable().<span class="kw">await</span><span class="question-mark">?</span>;
<span class="kw">let </span><span class="kw-2">mut </span>buf = Vec::with_capacity(<span class="number">4096</span>);
<span class="comment">// Try to read data, this may still fail with `WouldBlock`
// if the readiness event is a false positive.
</span><span class="kw">match </span>stream.try_read_buf(<span class="kw-2">&amp;mut </span>buf) {
<span class="prelude-val">Ok</span>(<span class="number">0</span>) =&gt; <span class="kw">break</span>,
<span class="prelude-val">Ok</span>(n) =&gt; {
<span class="macro">println!</span>(<span class="string">"read {} bytes"</span>, n);
}
<span class="prelude-val">Err</span>(<span class="kw-2">ref </span>e) <span class="kw">if </span>e.kind() == io::ErrorKind::WouldBlock =&gt; {
<span class="kw">continue</span>;
}
<span class="prelude-val">Err</span>(e) =&gt; {
<span class="kw">return </span><span class="prelude-val">Err</span>(e.into());
}
}
}
<span class="prelude-val">Ok</span>(())
}</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.writable" class="method"><a class="src rightside" href="../../src/tokio/net/unix/stream.rs.html#549-552">Source</a><h4 class="code-header">pub async fn <a href="#method.writable" class="fn">writable</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>&gt;</h4></section></summary><div class="docblock"><p>Waits for the socket to become writable.</p>
<p>This function is equivalent to <code>ready(Interest::WRITABLE)</code> and is usually
paired with <code>try_write()</code>.</p>
<h5 id="cancel-safety-2"><a class="doc-anchor" href="#cancel-safety-2">§</a>Cancel safety</h5>
<p>This method is cancel safe. Once a readiness event occurs, the method
will continue to return immediately until the readiness event is
consumed by an attempt to write that fails with <code>WouldBlock</code> or
<code>Poll::Pending</code>.</p>
<h5 id="examples-5"><a class="doc-anchor" href="#examples-5">§</a>Examples</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::net::UnixStream;
<span class="kw">use </span>std::error::Error;
<span class="kw">use </span>std::io;
<span class="attr">#[tokio::main]
</span><span class="kw">async fn </span>main() -&gt; <span class="prelude-ty">Result</span>&lt;(), Box&lt;<span class="kw">dyn </span>Error&gt;&gt; {
<span class="comment">// Connect to a peer
</span><span class="kw">let </span>dir = tempfile::tempdir().unwrap();
<span class="kw">let </span>bind_path = dir.path().join(<span class="string">"bind_path"</span>);
<span class="kw">let </span>stream = UnixStream::connect(bind_path).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="kw">loop </span>{
<span class="comment">// Wait for the socket to be writable
</span>stream.writable().<span class="kw">await</span><span class="question-mark">?</span>;
<span class="comment">// Try to write data, this may still fail with `WouldBlock`
// if the readiness event is a false positive.
</span><span class="kw">match </span>stream.try_write(<span class="string">b"hello world"</span>) {
<span class="prelude-val">Ok</span>(n) =&gt; {
<span class="kw">break</span>;
}
<span class="prelude-val">Err</span>(<span class="kw-2">ref </span>e) <span class="kw">if </span>e.kind() == io::ErrorKind::WouldBlock =&gt; {
<span class="kw">continue</span>;
}
<span class="prelude-val">Err</span>(e) =&gt; {
<span class="kw">return </span><span class="prelude-val">Err</span>(e.into());
}
}
}
<span class="prelude-val">Ok</span>(())
}</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.poll_write_ready" class="method"><a class="src rightside" href="../../src/tokio/net/unix/stream.rs.html#583-585">Source</a><h4 class="code-header">pub fn <a href="#method.poll_write_ready" class="fn">poll_write_ready</a>(&amp;self, cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.93.1/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/1.93.1/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>&gt;&gt;</h4></section></summary><div class="docblock"><p>Polls for write readiness.</p>
<p>If the unix stream is not currently ready for writing, this method will
store a clone of the <code>Waker</code> from the provided <code>Context</code>. When the unix
stream becomes ready for writing, <code>Waker::wake</code> will be called on the
waker.</p>
<p>Note that on multiple calls to <code>poll_write_ready</code> or <code>poll_write</code>, only
the <code>Waker</code> from the <code>Context</code> passed to the most recent call is
scheduled to receive a wakeup. (However, <code>poll_read_ready</code> retains a
second, independent waker.)</p>
<p>This function is intended for cases where creating and pinning a future
via <a href="struct.UnixStream.html#method.writable" title="method tokio::net::UnixStream::writable"><code>writable</code></a> is not feasible. Where possible, using <a href="struct.UnixStream.html#method.writable" title="method tokio::net::UnixStream::writable"><code>writable</code></a> is
preferred, as this supports polling from multiple tasks at once.</p>
<h5 id="return-value-1"><a class="doc-anchor" href="#return-value-1">§</a>Return value</h5>
<p>The function returns:</p>
<ul>
<li><code>Poll::Pending</code> if the unix stream is not ready for writing.</li>
<li><code>Poll::Ready(Ok(()))</code> if the unix stream is ready for writing.</li>
<li><code>Poll::Ready(Err(e))</code> if an error is encountered.</li>
</ul>
<h5 id="errors-1"><a class="doc-anchor" href="#errors-1">§</a>Errors</h5>
<p>This function may encounter any standard I/O error except <code>WouldBlock</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.try_write" class="method"><a class="src rightside" href="../../src/tokio/net/unix/stream.rs.html#637-641">Source</a><h4 class="code-header">pub fn <a href="#method.try_write" class="fn">try_write</a>(&amp;self, buf: &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>]) -&gt; <a class="type" href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>&gt;</h4></section></summary><div class="docblock"><p>Tries to write a buffer to the stream, returning how many bytes were
written.</p>
<p>The function will attempt to write the entire contents of <code>buf</code>, but
only part of the buffer may be written.</p>
<p>This function is usually paired with <code>writable()</code>.</p>
<h5 id="return-3"><a class="doc-anchor" href="#return-3">§</a>Return</h5>
<p>If data is successfully written, <code>Ok(n)</code> is returned, where <code>n</code> is the
number of bytes written. If the stream is not ready to write data,
<code>Err(io::ErrorKind::WouldBlock)</code> is returned.</p>
<h5 id="examples-6"><a class="doc-anchor" href="#examples-6">§</a>Examples</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::net::UnixStream;
<span class="kw">use </span>std::error::Error;
<span class="kw">use </span>std::io;
<span class="attr">#[tokio::main]
</span><span class="kw">async fn </span>main() -&gt; <span class="prelude-ty">Result</span>&lt;(), Box&lt;<span class="kw">dyn </span>Error&gt;&gt; {
<span class="comment">// Connect to a peer
</span><span class="kw">let </span>dir = tempfile::tempdir().unwrap();
<span class="kw">let </span>bind_path = dir.path().join(<span class="string">"bind_path"</span>);
<span class="kw">let </span>stream = UnixStream::connect(bind_path).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="kw">loop </span>{
<span class="comment">// Wait for the socket to be writable
</span>stream.writable().<span class="kw">await</span><span class="question-mark">?</span>;
<span class="comment">// Try to write data, this may still fail with `WouldBlock`
// if the readiness event is a false positive.
</span><span class="kw">match </span>stream.try_write(<span class="string">b"hello world"</span>) {
<span class="prelude-val">Ok</span>(n) =&gt; {
<span class="kw">break</span>;
}
<span class="prelude-val">Err</span>(<span class="kw-2">ref </span>e) <span class="kw">if </span>e.kind() == io::ErrorKind::WouldBlock =&gt; {
<span class="kw">continue</span>;
}
<span class="prelude-val">Err</span>(e) =&gt; {
<span class="kw">return </span><span class="prelude-val">Err</span>(e.into());
}
}
}
<span class="prelude-val">Ok</span>(())
}</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.try_write_vectored" class="method"><a class="src rightside" href="../../src/tokio/net/unix/stream.rs.html#699-703">Source</a><h4 class="code-header">pub fn <a href="#method.try_write_vectored" class="fn">try_write_vectored</a>(&amp;self, buf: &amp;[<a class="struct" href="https://doc.rust-lang.org/1.93.1/std/io/struct.IoSlice.html" title="struct std::io::IoSlice">IoSlice</a>&lt;'_&gt;]) -&gt; <a class="type" href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>&gt;</h4></section></summary><div class="docblock"><p>Tries to write several buffers to the stream, returning how many bytes
were written.</p>
<p>Data is written from each buffer in order, with the final buffer read
from possible being only partially consumed. This method behaves
equivalently to a single call to <a href="struct.UnixStream.html#method.try_write" title="method tokio::net::UnixStream::try_write"><code>try_write()</code></a> with concatenated
buffers.</p>
<p>This function is usually paired with <code>writable()</code>.</p>
<h5 id="return-4"><a class="doc-anchor" href="#return-4">§</a>Return</h5>
<p>If data is successfully written, <code>Ok(n)</code> is returned, where <code>n</code> is the
number of bytes written. If the stream is not ready to write data,
<code>Err(io::ErrorKind::WouldBlock)</code> is returned.</p>
<h5 id="examples-7"><a class="doc-anchor" href="#examples-7">§</a>Examples</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::net::UnixStream;
<span class="kw">use </span>std::error::Error;
<span class="kw">use </span>std::io;
<span class="attr">#[tokio::main]
</span><span class="kw">async fn </span>main() -&gt; <span class="prelude-ty">Result</span>&lt;(), Box&lt;<span class="kw">dyn </span>Error&gt;&gt; {
<span class="comment">// Connect to a peer
</span><span class="kw">let </span>dir = tempfile::tempdir().unwrap();
<span class="kw">let </span>bind_path = dir.path().join(<span class="string">"bind_path"</span>);
<span class="kw">let </span>stream = UnixStream::connect(bind_path).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="kw">let </span>bufs = [io::IoSlice::new(<span class="string">b"hello "</span>), io::IoSlice::new(<span class="string">b"world"</span>)];
<span class="kw">loop </span>{
<span class="comment">// Wait for the socket to be writable
</span>stream.writable().<span class="kw">await</span><span class="question-mark">?</span>;
<span class="comment">// Try to write data, this may still fail with `WouldBlock`
// if the readiness event is a false positive.
</span><span class="kw">match </span>stream.try_write_vectored(<span class="kw-2">&amp;</span>bufs) {
<span class="prelude-val">Ok</span>(n) =&gt; {
<span class="kw">break</span>;
}
<span class="prelude-val">Err</span>(<span class="kw-2">ref </span>e) <span class="kw">if </span>e.kind() == io::ErrorKind::WouldBlock =&gt; {
<span class="kw">continue</span>;
}
<span class="prelude-val">Err</span>(e) =&gt; {
<span class="kw">return </span><span class="prelude-val">Err</span>(e.into());
}
}
}
<span class="prelude-val">Ok</span>(())
}</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.try_io" class="method"><a class="src rightside" href="../../src/tokio/net/unix/stream.rs.html#737-745">Source</a><h4 class="code-header">pub fn <a href="#method.try_io" class="fn">try_io</a>&lt;R&gt;(
&amp;self,
interest: <a class="struct" href="../io/struct.Interest.html" title="struct tokio::io::Interest">Interest</a>,
f: impl <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>() -&gt; <a class="type" href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;R&gt;,
) -&gt; <a class="type" href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;R&gt;</h4></section></summary><div class="docblock"><p>Tries to read or write from the socket using a user-provided IO operation.</p>
<p>If the socket is ready, the provided closure is called. The closure
should attempt to perform IO operation on the socket by manually
calling the appropriate syscall. If the operation fails because the
socket is not actually ready, then the closure should return a
<code>WouldBlock</code> error and the readiness flag is cleared. The return value
of the closure is then returned by <code>try_io</code>.</p>
<p>If the socket is not ready, then the closure is not called
and a <code>WouldBlock</code> error is returned.</p>
<p>The closure should only return a <code>WouldBlock</code> error if it has performed
an IO operation on the socket that failed due to the socket not being
ready. Returning a <code>WouldBlock</code> error in any other situation will
incorrectly clear the readiness flag, which can cause the socket to
behave incorrectly.</p>
<p>The closure should not perform the IO operation using any of the methods
defined on the Tokio <code>UnixStream</code> type, as this will mess with the
readiness flag and can cause the socket to behave incorrectly.</p>
<p>This method is not intended to be used with combined interests.
The closure should perform only one type of IO operation, so it should not
require more than one ready state. This method may panic or sleep forever
if it is called with a combined interest.</p>
<p>Usually, <a href="struct.UnixStream.html#method.readable" title="method tokio::net::UnixStream::readable"><code>readable()</code></a>, <a href="struct.UnixStream.html#method.writable" title="method tokio::net::UnixStream::writable"><code>writable()</code></a> or <a href="struct.UnixStream.html#method.ready" title="method tokio::net::UnixStream::ready"><code>ready()</code></a> is used with this function.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.async_io" class="method"><a class="src rightside" href="../../src/tokio/net/unix/stream.rs.html#772-781">Source</a><h4 class="code-header">pub async fn <a href="#method.async_io" class="fn">async_io</a>&lt;R&gt;(
&amp;self,
interest: <a class="struct" href="../io/struct.Interest.html" title="struct tokio::io::Interest">Interest</a>,
f: impl <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>() -&gt; <a class="type" href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;R&gt;,
) -&gt; <a class="type" href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;R&gt;</h4></section></summary><div class="docblock"><p>Reads or writes from the socket using a user-provided IO operation.</p>
<p>The readiness of the socket is awaited and when the socket is ready,
the provided closure is called. The closure should attempt to perform
IO operation on the socket by manually calling the appropriate syscall.
If the operation fails because the socket is not actually ready,
then the closure should return a <code>WouldBlock</code> error. In such case the
readiness flag is cleared and the socket readiness is awaited again.
This loop is repeated until the closure returns an <code>Ok</code> or an error
other than <code>WouldBlock</code>.</p>
<p>The closure should only return a <code>WouldBlock</code> error if it has performed
an IO operation on the socket that failed due to the socket not being
ready. Returning a <code>WouldBlock</code> error in any other situation will
incorrectly clear the readiness flag, which can cause the socket to
behave incorrectly.</p>
<p>The closure should not perform the IO operation using any of the methods
defined on the Tokio <code>UnixStream</code> type, as this will mess with the
readiness flag and can cause the socket to behave incorrectly.</p>
<p>This method is not intended to be used with combined interests.
The closure should perform only one type of IO operation, so it should not
require more than one ready state. This method may panic or sleep forever
if it is called with a combined interest.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.from_std" class="method"><a class="src rightside" href="../../src/tokio/net/unix/stream.rs.html#825-832">Source</a><h4 class="code-header">pub fn <a href="#method.from_std" class="fn">from_std</a>(stream: <a class="struct" href="https://doc.rust-lang.org/1.93.1/std/os/unix/net/stream/struct.UnixStream.html" title="struct std::os::unix::net::stream::UnixStream">UnixStream</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="struct" href="struct.UnixStream.html" title="struct tokio::net::UnixStream">UnixStream</a>&gt;</h4></section></summary><div class="docblock"><p>Creates new <a href="struct.UnixStream.html" title="struct tokio::net::UnixStream"><code>UnixStream</code></a> from a <a href="https://doc.rust-lang.org/1.93.1/std/os/unix/net/stream/struct.UnixStream.html" title="struct std::os::unix::net::stream::UnixStream"><code>std::os::unix::net::UnixStream</code></a>.</p>
<p>This function is intended to be used to wrap a <code>UnixStream</code> from the
standard library in the Tokio equivalent.</p>
<h5 id="notes"><a class="doc-anchor" href="#notes">§</a>Notes</h5>
<p>The caller is responsible for ensuring that the stream is in
non-blocking mode. Otherwise all I/O operations on the stream
will block the thread, which will cause unexpected behavior.
Non-blocking mode can be set using <a href="https://doc.rust-lang.org/1.93.1/std/os/unix/net/stream/struct.UnixStream.html#method.set_nonblocking" title="method std::os::unix::net::stream::UnixStream::set_nonblocking"><code>set_nonblocking</code></a>.</p>
<p>Passing a listener in blocking mode is always erroneous,
and the behavior in that case may change in the future.
For example, it could panic.</p>
<h5 id="examples-8"><a class="doc-anchor" href="#examples-8">§</a>Examples</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::net::UnixStream;
<span class="kw">use </span>std::os::unix::net::UnixStream <span class="kw">as </span>StdUnixStream;
<span class="kw">let </span>std_stream = StdUnixStream::connect(<span class="string">"/path/to/the/socket"</span>)<span class="question-mark">?</span>;
std_stream.set_nonblocking(<span class="bool-val">true</span>)<span class="question-mark">?</span>;
<span class="kw">let </span>stream = UnixStream::from_std(std_stream)<span class="question-mark">?</span>;</code></pre></div><h5 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h5>
<p>This function panics if it is not called from within a runtime with
IO enabled.</p>
<p>The runtime is usually set implicitly when this function is called
from a future driven by a tokio runtime, otherwise runtime can be set
explicitly with <a href="../runtime/struct.Runtime.html#method.enter" title="method tokio::runtime::Runtime::enter"><code>Runtime::enter</code></a> function.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.into_std" class="method"><a class="src rightside" href="../../src/tokio/net/unix/stream.rs.html#873-878">Source</a><h4 class="code-header">pub fn <a href="#method.into_std" class="fn">into_std</a>(self) -&gt; <a class="type" href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.93.1/std/os/unix/net/stream/struct.UnixStream.html" title="struct std::os::unix::net::stream::UnixStream">UnixStream</a>&gt;</h4></section></summary><div class="docblock"><p>Turns a <a href="struct.UnixStream.html" title="struct tokio::net::UnixStream"><code>tokio::net::UnixStream</code></a> into a <a href="https://doc.rust-lang.org/1.93.1/std/os/unix/net/stream/struct.UnixStream.html" title="struct std::os::unix::net::stream::UnixStream"><code>std::os::unix::net::UnixStream</code></a>.</p>
<p>The returned <a href="https://doc.rust-lang.org/1.93.1/std/os/unix/net/stream/struct.UnixStream.html" title="struct std::os::unix::net::stream::UnixStream"><code>std::os::unix::net::UnixStream</code></a> will have nonblocking
mode set as <code>true</code>. Use <a href="https://doc.rust-lang.org/1.93.1/std/os/unix/net/stream/struct.UnixStream.html#method.set_nonblocking" title="method std::os::unix::net::stream::UnixStream::set_nonblocking"><code>set_nonblocking</code></a> to change the blocking
mode if needed.</p>
<h5 id="examples-9"><a class="doc-anchor" href="#examples-9">§</a>Examples</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::error::Error;
<span class="kw">use </span>std::io::Read;
<span class="kw">use </span>tokio::net::UnixListener;
<span class="attr">#[tokio::main]
</span><span class="kw">async fn </span>main() -&gt; <span class="prelude-ty">Result</span>&lt;(), Box&lt;<span class="kw">dyn </span>Error&gt;&gt; {
<span class="kw">let </span>dir = tempfile::tempdir().unwrap();
<span class="kw">let </span>bind_path = dir.path().join(<span class="string">"bind_path"</span>);
<span class="kw">let </span><span class="kw-2">mut </span>data = [<span class="number">0u8</span>; <span class="number">12</span>];
<span class="kw">let </span>listener = UnixListener::bind(<span class="kw-2">&amp;</span>bind_path)<span class="question-mark">?</span>;
<span class="kw">let </span>(tokio_unix_stream, <span class="kw">_</span>) = listener.accept().<span class="kw">await</span><span class="question-mark">?</span>;
<span class="kw">let </span><span class="kw-2">mut </span>std_unix_stream = tokio_unix_stream.into_std()<span class="question-mark">?</span>;
std_unix_stream.set_nonblocking(<span class="bool-val">false</span>)<span class="question-mark">?</span>;
std_unix_stream.read_exact(<span class="kw-2">&amp;mut </span>data)<span class="question-mark">?</span>;
<span class="prelude-val">Ok</span>(())
}</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.pair" class="method"><a class="src rightside" href="../../src/tokio/net/unix/stream.rs.html#885-891">Source</a><h4 class="code-header">pub fn <a href="#method.pair" class="fn">pair</a>() -&gt; <a class="type" href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;(<a class="struct" href="struct.UnixStream.html" title="struct tokio::net::UnixStream">UnixStream</a>, <a class="struct" href="struct.UnixStream.html" title="struct tokio::net::UnixStream">UnixStream</a>)&gt;</h4></section></summary><div class="docblock"><p>Creates an unnamed pair of connected sockets.</p>
<p>This function will create a pair of interconnected Unix sockets for
communicating back and forth between one another. Each socket will
be associated with the default event loops handle.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.local_addr" class="method"><a class="src rightside" href="../../src/tokio/net/unix/stream.rs.html#914-916">Source</a><h4 class="code-header">pub fn <a href="#method.local_addr" class="fn">local_addr</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="struct" href="unix/struct.SocketAddr.html" title="struct tokio::net::unix::SocketAddr">SocketAddr</a>&gt;</h4></section></summary><div class="docblock"><p>Returns the socket address of the local half of this connection.</p>
<h5 id="examples-10"><a class="doc-anchor" href="#examples-10">§</a>Examples</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::net::UnixStream;
<span class="kw">let </span>dir = tempfile::tempdir().unwrap();
<span class="kw">let </span>bind_path = dir.path().join(<span class="string">"bind_path"</span>);
<span class="kw">let </span>stream = UnixStream::connect(bind_path).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="macro">println!</span>(<span class="string">"{:?}"</span>, stream.local_addr()<span class="question-mark">?</span>);</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.peer_addr" class="method"><a class="src rightside" href="../../src/tokio/net/unix/stream.rs.html#934-936">Source</a><h4 class="code-header">pub fn <a href="#method.peer_addr" class="fn">peer_addr</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="struct" href="unix/struct.SocketAddr.html" title="struct tokio::net::unix::SocketAddr">SocketAddr</a>&gt;</h4></section></summary><div class="docblock"><p>Returns the socket address of the remote half of this connection.</p>
<h5 id="examples-11"><a class="doc-anchor" href="#examples-11">§</a>Examples</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::net::UnixStream;
<span class="kw">let </span>dir = tempfile::tempdir().unwrap();
<span class="kw">let </span>bind_path = dir.path().join(<span class="string">"bind_path"</span>);
<span class="kw">let </span>stream = UnixStream::connect(bind_path).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="macro">println!</span>(<span class="string">"{:?}"</span>, stream.peer_addr()<span class="question-mark">?</span>);</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.peer_cred" class="method"><a class="src rightside" href="../../src/tokio/net/unix/stream.rs.html#939-941">Source</a><h4 class="code-header">pub fn <a href="#method.peer_cred" class="fn">peer_cred</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="struct" href="unix/struct.UCred.html" title="struct tokio::net::unix::UCred">UCred</a>&gt;</h4></section></summary><div class="docblock"><p>Returns effective credentials of the process which called <code>connect</code> or <code>pair</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.take_error" class="method"><a class="src rightside" href="../../src/tokio/net/unix/stream.rs.html#944-946">Source</a><h4 class="code-header">pub fn <a href="#method.take_error" class="fn">take_error</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.93.1/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>&gt;&gt;</h4></section></summary><div class="docblock"><p>Returns the value of the <code>SO_ERROR</code> option.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.split" class="method"><a class="src rightside" href="../../src/tokio/net/unix/stream.rs.html#967-969">Source</a><h4 class="code-header">pub fn <a href="#method.split" class="fn">split</a>&lt;'a&gt;(&amp;'a mut self) -&gt; (<a class="struct" href="unix/struct.ReadHalf.html" title="struct tokio::net::unix::ReadHalf">ReadHalf</a>&lt;'a&gt;, <a class="struct" href="unix/struct.WriteHalf.html" title="struct tokio::net::unix::WriteHalf">WriteHalf</a>&lt;'a&gt;)</h4></section></summary><div class="docblock"><p>Splits a <code>UnixStream</code> into a read half and a write half, which can be used
to read and write the stream concurrently.</p>
<p>This method is more efficient than <a href="struct.UnixStream.html#method.into_split" title="method tokio::net::UnixStream::into_split"><code>into_split</code></a>, but the halves cannot be
moved into independently spawned tasks.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.into_split" class="method"><a class="src rightside" href="../../src/tokio/net/unix/stream.rs.html#982-984">Source</a><h4 class="code-header">pub fn <a href="#method.into_split" class="fn">into_split</a>(self) -&gt; (<a class="struct" href="unix/struct.OwnedReadHalf.html" title="struct tokio::net::unix::OwnedReadHalf">OwnedReadHalf</a>, <a class="struct" href="unix/struct.OwnedWriteHalf.html" title="struct tokio::net::unix::OwnedWriteHalf">OwnedWriteHalf</a>)</h4></section></summary><div class="docblock"><p>Splits a <code>UnixStream</code> into a read half and a write half, which can be used
to read and write the stream concurrently.</p>
<p>Unlike <a href="struct.UnixStream.html#method.split" title="method tokio::net::UnixStream::split"><code>split</code></a>, the owned halves can be moved to separate tasks, however
this comes at the cost of a heap allocation.</p>
<p><strong>Note:</strong> Dropping the write half will only shut down the write half of the
stream. This is equivalent to calling <a href="../io/trait.AsyncWriteExt.html#method.shutdown" title="method tokio::io::AsyncWriteExt::shutdown"><code>shutdown()</code></a> on the <code>UnixStream</code>.</p>
</div></details></div></details></div><h2 id="trait-implementations" class="section-header">Trait Implementations<a href="#trait-implementations" class="anchor">§</a></h2><div id="trait-implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-AsFd-for-UnixStream" class="impl"><a class="src rightside" href="../../src/tokio/net/unix/stream.rs.html#1091-1095">Source</a><a href="#impl-AsFd-for-UnixStream" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.93.1/std/os/fd/owned/trait.AsFd.html" title="trait std::os::fd::owned::AsFd">AsFd</a> for <a class="struct" href="struct.UnixStream.html" title="struct tokio::net::UnixStream">UnixStream</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.as_fd" class="method trait-impl"><a class="src rightside" href="../../src/tokio/net/unix/stream.rs.html#1092-1094">Source</a><a href="#method.as_fd" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/std/os/fd/owned/trait.AsFd.html#tymethod.as_fd" class="fn">as_fd</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/std/os/fd/owned/struct.BorrowedFd.html" title="struct std::os::fd::owned::BorrowedFd">BorrowedFd</a>&lt;'_&gt;</h4></section></summary><div class='docblock'>Borrows the file descriptor. <a href="https://doc.rust-lang.org/1.93.1/std/os/fd/owned/trait.AsFd.html#tymethod.as_fd">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-AsRawFd-for-UnixStream" class="impl"><a class="src rightside" href="../../src/tokio/net/unix/stream.rs.html#1085-1089">Source</a><a href="#impl-AsRawFd-for-UnixStream" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.93.1/std/os/fd/raw/trait.AsRawFd.html" title="trait std::os::fd::raw::AsRawFd">AsRawFd</a> for <a class="struct" href="struct.UnixStream.html" title="struct tokio::net::UnixStream">UnixStream</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.as_raw_fd" class="method trait-impl"><a class="src rightside" href="../../src/tokio/net/unix/stream.rs.html#1086-1088">Source</a><a href="#method.as_raw_fd" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/std/os/fd/raw/trait.AsRawFd.html#tymethod.as_raw_fd" class="fn">as_raw_fd</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/1.93.1/std/os/fd/raw/type.RawFd.html" title="type std::os::fd::raw::RawFd">RawFd</a></h4></section></summary><div class='docblock'>Extracts the raw file descriptor. <a href="https://doc.rust-lang.org/1.93.1/std/os/fd/raw/trait.AsRawFd.html#tymethod.as_raw_fd">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-AsRef%3CUnixStream%3E-for-OwnedReadHalf" class="impl"><a class="src rightside" href="../../src/tokio/net/unix/split_owned.rs.html#409-413">Source</a><a href="#impl-AsRef%3CUnixStream%3E-for-OwnedReadHalf" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;<a class="struct" href="struct.UnixStream.html" title="struct tokio::net::UnixStream">UnixStream</a>&gt; for <a class="struct" href="unix/struct.OwnedReadHalf.html" title="struct tokio::net::unix::OwnedReadHalf">OwnedReadHalf</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.as_ref-2" class="method trait-impl"><a class="src rightside" href="../../src/tokio/net/unix/split_owned.rs.html#410-412">Source</a><a href="#method.as_ref-2" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.AsRef.html#tymethod.as_ref" class="fn">as_ref</a>(&amp;self) -&gt; &amp;<a class="struct" href="struct.UnixStream.html" title="struct tokio::net::UnixStream">UnixStream</a></h4></section></summary><div class='docblock'>Converts this type into a shared reference of the (usually inferred) input type.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-AsRef%3CUnixStream%3E-for-OwnedWriteHalf" class="impl"><a class="src rightside" href="../../src/tokio/net/unix/split_owned.rs.html#415-419">Source</a><a href="#impl-AsRef%3CUnixStream%3E-for-OwnedWriteHalf" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;<a class="struct" href="struct.UnixStream.html" title="struct tokio::net::UnixStream">UnixStream</a>&gt; for <a class="struct" href="unix/struct.OwnedWriteHalf.html" title="struct tokio::net::unix::OwnedWriteHalf">OwnedWriteHalf</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.as_ref-3" class="method trait-impl"><a class="src rightside" href="../../src/tokio/net/unix/split_owned.rs.html#416-418">Source</a><a href="#method.as_ref-3" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.AsRef.html#tymethod.as_ref" class="fn">as_ref</a>(&amp;self) -&gt; &amp;<a class="struct" href="struct.UnixStream.html" title="struct tokio::net::UnixStream">UnixStream</a></h4></section></summary><div class='docblock'>Converts this type into a shared reference of the (usually inferred) input type.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-AsRef%3CUnixStream%3E-for-ReadHalf%3C'_%3E" class="impl"><a class="src rightside" href="../../src/tokio/net/unix/split.rs.html#321-325">Source</a><a href="#impl-AsRef%3CUnixStream%3E-for-ReadHalf%3C'_%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;<a class="struct" href="struct.UnixStream.html" title="struct tokio::net::UnixStream">UnixStream</a>&gt; for <a class="struct" href="unix/struct.ReadHalf.html" title="struct tokio::net::unix::ReadHalf">ReadHalf</a>&lt;'_&gt;</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.as_ref" class="method trait-impl"><a class="src rightside" href="../../src/tokio/net/unix/split.rs.html#322-324">Source</a><a href="#method.as_ref" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.AsRef.html#tymethod.as_ref" class="fn">as_ref</a>(&amp;self) -&gt; &amp;<a class="struct" href="struct.UnixStream.html" title="struct tokio::net::UnixStream">UnixStream</a></h4></section></summary><div class='docblock'>Converts this type into a shared reference of the (usually inferred) input type.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-AsRef%3CUnixStream%3E-for-UnixStream" class="impl"><a class="src rightside" href="../../src/tokio/net/unix/stream.rs.html#1079-1083">Source</a><a href="#impl-AsRef%3CUnixStream%3E-for-UnixStream" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;<a class="struct" href="struct.UnixStream.html" title="struct tokio::net::UnixStream">UnixStream</a>&gt; for <a class="struct" href="struct.UnixStream.html" title="struct tokio::net::UnixStream">UnixStream</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.as_ref-4" class="method trait-impl"><a class="src rightside" href="../../src/tokio/net/unix/stream.rs.html#1080-1082">Source</a><a href="#method.as_ref-4" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.AsRef.html#tymethod.as_ref" class="fn">as_ref</a>(&amp;self) -&gt; &amp;Self</h4></section></summary><div class='docblock'>Converts this type into a shared reference of the (usually inferred) input type.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-AsRef%3CUnixStream%3E-for-WriteHalf%3C'_%3E" class="impl"><a class="src rightside" href="../../src/tokio/net/unix/split.rs.html#327-331">Source</a><a href="#impl-AsRef%3CUnixStream%3E-for-WriteHalf%3C'_%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;<a class="struct" href="struct.UnixStream.html" title="struct tokio::net::UnixStream">UnixStream</a>&gt; for <a class="struct" href="unix/struct.WriteHalf.html" title="struct tokio::net::unix::WriteHalf">WriteHalf</a>&lt;'_&gt;</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.as_ref-1" class="method trait-impl"><a class="src rightside" href="../../src/tokio/net/unix/split.rs.html#328-330">Source</a><a href="#method.as_ref-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.AsRef.html#tymethod.as_ref" class="fn">as_ref</a>(&amp;self) -&gt; &amp;<a class="struct" href="struct.UnixStream.html" title="struct tokio::net::UnixStream">UnixStream</a></h4></section></summary><div class='docblock'>Converts this type into a shared reference of the (usually inferred) input type.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-AsyncRead-for-UnixStream" class="impl"><a class="src rightside" href="../../src/tokio/net/unix/stream.rs.html#999-1007">Source</a><a href="#impl-AsyncRead-for-UnixStream" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../io/trait.AsyncRead.html" title="trait tokio::io::AsyncRead">AsyncRead</a> for <a class="struct" href="struct.UnixStream.html" title="struct tokio::net::UnixStream">UnixStream</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.poll_read" class="method trait-impl"><a class="src rightside" href="../../src/tokio/net/unix/stream.rs.html#1000-1006">Source</a><a href="#method.poll_read" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncRead.html#tymethod.poll_read" class="fn">poll_read</a>(
self: <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;&amp;mut Self&gt;,
cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;,
buf: &amp;mut <a class="struct" href="../io/struct.ReadBuf.html" title="struct tokio::io::ReadBuf">ReadBuf</a>&lt;'_&gt;,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>&gt;&gt;</h4></section></summary><div class='docblock'>Attempts to read from the <code>AsyncRead</code> into <code>buf</code>. <a href="../io/trait.AsyncRead.html#tymethod.poll_read">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-AsyncWrite-for-UnixStream" class="impl"><a class="src rightside" href="../../src/tokio/net/unix/stream.rs.html#1009-1038">Source</a><a href="#impl-AsyncWrite-for-UnixStream" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../io/trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite">AsyncWrite</a> for <a class="struct" href="struct.UnixStream.html" title="struct tokio::net::UnixStream">UnixStream</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.poll_write" class="method trait-impl"><a class="src rightside" href="../../src/tokio/net/unix/stream.rs.html#1010-1016">Source</a><a href="#method.poll_write" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncWrite.html#tymethod.poll_write" class="fn">poll_write</a>(
self: <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;&amp;mut Self&gt;,
cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;,
buf: &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>],
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>&gt;&gt;</h4></section></summary><div class='docblock'>Attempt to write bytes from <code>buf</code> into the object. <a href="../io/trait.AsyncWrite.html#tymethod.poll_write">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.poll_write_vectored" class="method trait-impl"><a class="src rightside" href="../../src/tokio/net/unix/stream.rs.html#1018-1024">Source</a><a href="#method.poll_write_vectored" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncWrite.html#method.poll_write_vectored" class="fn">poll_write_vectored</a>(
self: <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;&amp;mut Self&gt;,
cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;,
bufs: &amp;[<a class="struct" href="https://doc.rust-lang.org/1.93.1/std/io/struct.IoSlice.html" title="struct std::io::IoSlice">IoSlice</a>&lt;'_&gt;],
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>&gt;&gt;</h4></section></summary><div class='docblock'>Like <a href="../io/trait.AsyncWrite.html#tymethod.poll_write" title="method tokio::io::AsyncWrite::poll_write"><code>poll_write</code></a>, except that it writes from a slice of buffers. <a href="../io/trait.AsyncWrite.html#method.poll_write_vectored">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.is_write_vectored" class="method trait-impl"><a class="src rightside" href="../../src/tokio/net/unix/stream.rs.html#1026-1028">Source</a><a href="#method.is_write_vectored" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncWrite.html#method.is_write_vectored" class="fn">is_write_vectored</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Determines if this writer has an efficient <a href="../io/trait.AsyncWrite.html#method.poll_write_vectored" title="method tokio::io::AsyncWrite::poll_write_vectored"><code>poll_write_vectored</code></a>
implementation. <a href="../io/trait.AsyncWrite.html#method.is_write_vectored">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.poll_flush" class="method trait-impl"><a class="src rightside" href="../../src/tokio/net/unix/stream.rs.html#1030-1032">Source</a><a href="#method.poll_flush" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncWrite.html#tymethod.poll_flush" class="fn">poll_flush</a>(self: <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;&amp;mut Self&gt;, _: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.93.1/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/1.93.1/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>&gt;&gt;</h4></section></summary><div class='docblock'>Attempts to flush the object, ensuring that any buffered data reach
their destination. <a href="../io/trait.AsyncWrite.html#tymethod.poll_flush">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.poll_shutdown" class="method trait-impl"><a class="src rightside" href="../../src/tokio/net/unix/stream.rs.html#1034-1037">Source</a><a href="#method.poll_shutdown" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncWrite.html#tymethod.poll_shutdown" class="fn">poll_shutdown</a>(self: <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;&amp;mut Self&gt;, _: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.93.1/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/1.93.1/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>&gt;&gt;</h4></section></summary><div class='docblock'>Initiates or attempts to shut down this writer, returning success when
the I/O connection has completely shut down. <a href="../io/trait.AsyncWrite.html#tymethod.poll_shutdown">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Debug-for-UnixStream" class="impl"><a class="src rightside" href="../../src/tokio/net/unix/stream.rs.html#1073-1077">Source</a><a href="#impl-Debug-for-UnixStream" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="struct.UnixStream.html" title="struct tokio::net::UnixStream">UnixStream</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl"><a class="src rightside" href="../../src/tokio/net/unix/stream.rs.html#1074-1076">Source</a><a href="#method.fmt" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/fmt/trait.Debug.html#tymethod.fmt" class="fn">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/1.93.1/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></section></summary><div class='docblock'>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/1.93.1/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-TryFrom%3CUnixStream%3E-for-UnixStream" class="impl"><a class="src rightside" href="../../src/tokio/net/unix/stream.rs.html#987-997">Source</a><a href="#impl-TryFrom%3CUnixStream%3E-for-UnixStream" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.93.1/std/os/unix/net/stream/struct.UnixStream.html" title="struct std::os::unix::net::stream::UnixStream">UnixStream</a>&gt; for <a class="struct" href="struct.UnixStream.html" title="struct tokio::net::UnixStream">UnixStream</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl"><a class="src rightside" href="../../src/tokio/net/unix/stream.rs.html#994-996">Source</a><a href="#method.try_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(stream: <a class="struct" href="https://doc.rust-lang.org/1.93.1/std/os/unix/net/stream/struct.UnixStream.html" title="struct std::os::unix::net::stream::UnixStream">UnixStream</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;Self&gt;</h4></section></summary><div class="docblock"><p>Consumes stream, returning the tokio I/O object.</p>
<p>This is equivalent to
<a href="struct.UnixStream.html#method.from_std" title="associated function tokio::net::UnixStream::from_std"><code>UnixStream::from_std(stream)</code></a>.</p>
</div></details><details class="toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl"><a class="src rightside" href="../../src/tokio/net/unix/stream.rs.html#988">Source</a><a href="#associatedtype.Error" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/1.93.1/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details></div></details></div><h2 id="synthetic-implementations" class="section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor">§</a></h2><div id="synthetic-implementations-list"><section id="impl-Freeze-for-UnixStream" class="impl"><a href="#impl-Freeze-for-UnixStream" class="anchor">§</a><h3 class="code-header">impl !<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Freeze.html" title="trait core::marker::Freeze">Freeze</a> for <a class="struct" href="struct.UnixStream.html" title="struct tokio::net::UnixStream">UnixStream</a></h3></section><section id="impl-RefUnwindSafe-for-UnixStream" class="impl"><a href="#impl-RefUnwindSafe-for-UnixStream" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.UnixStream.html" title="struct tokio::net::UnixStream">UnixStream</a></h3></section><section id="impl-Send-for-UnixStream" class="impl"><a href="#impl-Send-for-UnixStream" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.UnixStream.html" title="struct tokio::net::UnixStream">UnixStream</a></h3></section><section id="impl-Sync-for-UnixStream" class="impl"><a href="#impl-Sync-for-UnixStream" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.UnixStream.html" title="struct tokio::net::UnixStream">UnixStream</a></h3></section><section id="impl-Unpin-for-UnixStream" class="impl"><a href="#impl-Unpin-for-UnixStream" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.UnixStream.html" title="struct tokio::net::UnixStream">UnixStream</a></h3></section><section id="impl-UnwindSafe-for-UnixStream" class="impl"><a href="#impl-UnwindSafe-for-UnixStream" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.UnixStream.html" title="struct tokio::net::UnixStream">UnixStream</a></h3></section></div><h2 id="blanket-implementations" class="section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor">§</a></h2><div id="blanket-implementations-list"><details class="toggle implementors-toggle"><summary><section id="impl-Any-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/any.rs.html#138">Source</a><a href="#impl-Any-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T<div class="where">where
T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/any.rs.html#139">Source</a><a href="#method.type_id" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/any/trait.Any.html#tymethod.type_id" class="fn">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></section></summary><div class='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.93.1/core/any/trait.Any.html#tymethod.type_id">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-AsyncReadExt-for-R" class="impl"><a class="src rightside" href="../../src/tokio/io/util/async_read_ext.rs.html#1454">Source</a><a href="#impl-AsyncReadExt-for-R" class="anchor">§</a><h3 class="code-header">impl&lt;R&gt; <a class="trait" href="../io/trait.AsyncReadExt.html" title="trait tokio::io::AsyncReadExt">AsyncReadExt</a> for R<div class="where">where
R: <a class="trait" href="../io/trait.AsyncRead.html" title="trait tokio::io::AsyncRead">AsyncRead</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.chain" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_read_ext.rs.html#98-104">Source</a><a href="#method.chain" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncReadExt.html#method.chain" class="fn">chain</a>&lt;R&gt;(self, next: R) -&gt; <a class="struct" href="../io/struct.Chain.html" title="struct tokio::io::Chain">Chain</a>&lt;Self, R&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
R: <a class="trait" href="../io/trait.AsyncRead.html" title="trait tokio::io::AsyncRead">AsyncRead</a>,</div></h4></section></summary><div class='docblock'>Creates a new <code>AsyncRead</code> instance that chains this stream with
<code>next</code>. <a href="../io/trait.AsyncReadExt.html#method.chain">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.read" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_read_ext.rs.html#177-182">Source</a><a href="#method.read" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncReadExt.html#method.read" class="fn">read</a>&lt;'a&gt;(&amp;'a mut self, buf: &amp;'a mut [<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>]) -&gt; Read&lt;'a, Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Pulls some bytes from this source into the specified buffer,
returning how many bytes were read. <a href="../io/trait.AsyncReadExt.html#method.read">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.read_buf" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_read_ext.rs.html#258-264">Source</a><a href="#method.read_buf" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncReadExt.html#method.read_buf" class="fn">read_buf</a>&lt;'a, B&gt;(&amp;'a mut self, buf: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;'a mut B</a>) -&gt; ReadBuf&lt;'a, Self, B&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,
B: <a class="trait" href="../../bytes/buf/buf_mut/trait.BufMut.html" title="trait bytes::buf::buf_mut::BufMut">BufMut</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class='docblock'>Pulls some bytes from this source into the specified buffer,
advancing the buffers internal cursor. <a href="../io/trait.AsyncReadExt.html#method.read_buf">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.read_exact" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_read_ext.rs.html#323-328">Source</a><a href="#method.read_exact" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncReadExt.html#method.read_exact" class="fn">read_exact</a>&lt;'a&gt;(&amp;'a mut self, buf: &amp;'a mut [<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>]) -&gt; ReadExact&lt;'a, Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Reads the exact number of bytes required to fill <code>buf</code>. <a href="../io/trait.AsyncReadExt.html#method.read_exact">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.read_u8" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_read_ext.rs.html#330-1304">Source</a><a href="#method.read_u8" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncReadExt.html#method.read_u8" class="fn">read_u8</a>(&amp;mut self) -&gt; ReadU8&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Reads an unsigned 8 bit integer from the underlying reader. <a href="../io/trait.AsyncReadExt.html#method.read_u8">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.read_i8" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_read_ext.rs.html#330-1304">Source</a><a href="#method.read_i8" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncReadExt.html#method.read_i8" class="fn">read_i8</a>(&amp;mut self) -&gt; ReadI8&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Reads a signed 8 bit integer from the underlying reader. <a href="../io/trait.AsyncReadExt.html#method.read_i8">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.read_u16" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_read_ext.rs.html#330-1304">Source</a><a href="#method.read_u16" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncReadExt.html#method.read_u16" class="fn">read_u16</a>(&amp;mut self) -&gt; ReadU16&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Reads an unsigned 16-bit integer in big-endian order from the
underlying reader. <a href="../io/trait.AsyncReadExt.html#method.read_u16">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.read_i16" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_read_ext.rs.html#330-1304">Source</a><a href="#method.read_i16" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncReadExt.html#method.read_i16" class="fn">read_i16</a>(&amp;mut self) -&gt; ReadI16&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Reads a signed 16-bit integer in big-endian order from the
underlying reader. <a href="../io/trait.AsyncReadExt.html#method.read_i16">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.read_u32" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_read_ext.rs.html#330-1304">Source</a><a href="#method.read_u32" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncReadExt.html#method.read_u32" class="fn">read_u32</a>(&amp;mut self) -&gt; ReadU32&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Reads an unsigned 32-bit integer in big-endian order from the
underlying reader. <a href="../io/trait.AsyncReadExt.html#method.read_u32">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.read_i32" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_read_ext.rs.html#330-1304">Source</a><a href="#method.read_i32" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncReadExt.html#method.read_i32" class="fn">read_i32</a>(&amp;mut self) -&gt; ReadI32&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Reads a signed 32-bit integer in big-endian order from the
underlying reader. <a href="../io/trait.AsyncReadExt.html#method.read_i32">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.read_u64" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_read_ext.rs.html#330-1304">Source</a><a href="#method.read_u64" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncReadExt.html#method.read_u64" class="fn">read_u64</a>(&amp;mut self) -&gt; ReadU64&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Reads an unsigned 64-bit integer in big-endian order from the
underlying reader. <a href="../io/trait.AsyncReadExt.html#method.read_u64">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.read_i64" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_read_ext.rs.html#330-1304">Source</a><a href="#method.read_i64" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncReadExt.html#method.read_i64" class="fn">read_i64</a>(&amp;mut self) -&gt; ReadI64&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Reads an signed 64-bit integer in big-endian order from the
underlying reader. <a href="../io/trait.AsyncReadExt.html#method.read_i64">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.read_u128" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_read_ext.rs.html#330-1304">Source</a><a href="#method.read_u128" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncReadExt.html#method.read_u128" class="fn">read_u128</a>(&amp;mut self) -&gt; ReadU128&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Reads an unsigned 128-bit integer in big-endian order from the
underlying reader. <a href="../io/trait.AsyncReadExt.html#method.read_u128">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.read_i128" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_read_ext.rs.html#330-1304">Source</a><a href="#method.read_i128" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncReadExt.html#method.read_i128" class="fn">read_i128</a>(&amp;mut self) -&gt; ReadI128&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Reads an signed 128-bit integer in big-endian order from the
underlying reader. <a href="../io/trait.AsyncReadExt.html#method.read_i128">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.read_f32" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_read_ext.rs.html#330-1304">Source</a><a href="#method.read_f32" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncReadExt.html#method.read_f32" class="fn">read_f32</a>(&amp;mut self) -&gt; ReadF32&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Reads an 32-bit floating point type in big-endian order from the
underlying reader. <a href="../io/trait.AsyncReadExt.html#method.read_f32">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.read_f64" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_read_ext.rs.html#330-1304">Source</a><a href="#method.read_f64" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncReadExt.html#method.read_f64" class="fn">read_f64</a>(&amp;mut self) -&gt; ReadF64&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Reads an 64-bit floating point type in big-endian order from the
underlying reader. <a href="../io/trait.AsyncReadExt.html#method.read_f64">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.read_u16_le" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_read_ext.rs.html#330-1304">Source</a><a href="#method.read_u16_le" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncReadExt.html#method.read_u16_le" class="fn">read_u16_le</a>(&amp;mut self) -&gt; ReadU16Le&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Reads an unsigned 16-bit integer in little-endian order from the
underlying reader. <a href="../io/trait.AsyncReadExt.html#method.read_u16_le">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.read_i16_le" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_read_ext.rs.html#330-1304">Source</a><a href="#method.read_i16_le" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncReadExt.html#method.read_i16_le" class="fn">read_i16_le</a>(&amp;mut self) -&gt; ReadI16Le&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Reads a signed 16-bit integer in little-endian order from the
underlying reader. <a href="../io/trait.AsyncReadExt.html#method.read_i16_le">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.read_u32_le" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_read_ext.rs.html#330-1304">Source</a><a href="#method.read_u32_le" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncReadExt.html#method.read_u32_le" class="fn">read_u32_le</a>(&amp;mut self) -&gt; ReadU32Le&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Reads an unsigned 32-bit integer in little-endian order from the
underlying reader. <a href="../io/trait.AsyncReadExt.html#method.read_u32_le">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.read_i32_le" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_read_ext.rs.html#330-1304">Source</a><a href="#method.read_i32_le" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncReadExt.html#method.read_i32_le" class="fn">read_i32_le</a>(&amp;mut self) -&gt; ReadI32Le&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Reads a signed 32-bit integer in little-endian order from the
underlying reader. <a href="../io/trait.AsyncReadExt.html#method.read_i32_le">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.read_u64_le" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_read_ext.rs.html#330-1304">Source</a><a href="#method.read_u64_le" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncReadExt.html#method.read_u64_le" class="fn">read_u64_le</a>(&amp;mut self) -&gt; ReadU64Le&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Reads an unsigned 64-bit integer in little-endian order from the
underlying reader. <a href="../io/trait.AsyncReadExt.html#method.read_u64_le">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.read_i64_le" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_read_ext.rs.html#330-1304">Source</a><a href="#method.read_i64_le" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncReadExt.html#method.read_i64_le" class="fn">read_i64_le</a>(&amp;mut self) -&gt; ReadI64Le&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Reads an signed 64-bit integer in little-endian order from the
underlying reader. <a href="../io/trait.AsyncReadExt.html#method.read_i64_le">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.read_u128_le" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_read_ext.rs.html#330-1304">Source</a><a href="#method.read_u128_le" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncReadExt.html#method.read_u128_le" class="fn">read_u128_le</a>(&amp;mut self) -&gt; ReadU128Le&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Reads an unsigned 128-bit integer in little-endian order from the
underlying reader. <a href="../io/trait.AsyncReadExt.html#method.read_u128_le">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.read_i128_le" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_read_ext.rs.html#330-1304">Source</a><a href="#method.read_i128_le" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncReadExt.html#method.read_i128_le" class="fn">read_i128_le</a>(&amp;mut self) -&gt; ReadI128Le&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Reads an signed 128-bit integer in little-endian order from the
underlying reader. <a href="../io/trait.AsyncReadExt.html#method.read_i128_le">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.read_f32_le" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_read_ext.rs.html#330-1304">Source</a><a href="#method.read_f32_le" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncReadExt.html#method.read_f32_le" class="fn">read_f32_le</a>(&amp;mut self) -&gt; ReadF32Le&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Reads an 32-bit floating point type in little-endian order from the
underlying reader. <a href="../io/trait.AsyncReadExt.html#method.read_f32_le">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.read_f64_le" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_read_ext.rs.html#330-1304">Source</a><a href="#method.read_f64_le" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncReadExt.html#method.read_f64_le" class="fn">read_f64_le</a>(&amp;mut self) -&gt; ReadF64Le&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Reads an 64-bit floating point type in little-endian order from the
underlying reader. <a href="../io/trait.AsyncReadExt.html#method.read_f64_le">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.read_to_end" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_read_ext.rs.html#1354-1359">Source</a><a href="#method.read_to_end" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncReadExt.html#method.read_to_end" class="fn">read_to_end</a>&lt;'a&gt;(&amp;'a mut self, buf: &amp;'a mut <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>&gt;) -&gt; ReadToEnd&lt;'a, Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Reads all bytes until EOF in this source, placing them into <code>buf</code>. <a href="../io/trait.AsyncReadExt.html#method.read_to_end">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.read_to_string" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_read_ext.rs.html#1404-1409">Source</a><a href="#method.read_to_string" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncReadExt.html#method.read_to_string" class="fn">read_to_string</a>&lt;'a&gt;(
&amp;'a mut self,
dst: &amp;'a mut <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>,
) -&gt; ReadToString&lt;'a, Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Reads all bytes until EOF in this source, appending them to <code>buf</code>. <a href="../io/trait.AsyncReadExt.html#method.read_to_string">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.take" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_read_ext.rs.html#1445-1450">Source</a><a href="#method.take" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncReadExt.html#method.take" class="fn">take</a>(self, limit: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a>) -&gt; <a class="struct" href="../io/struct.Take.html" title="struct tokio::io::Take">Take</a>&lt;Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class='docblock'>Creates an adaptor which reads at most <code>limit</code> bytes from it. <a href="../io/trait.AsyncReadExt.html#method.take">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-AsyncWriteExt-for-W" class="impl"><a class="src rightside" href="../../src/tokio/io/util/async_write_ext.rs.html#1332">Source</a><a href="#impl-AsyncWriteExt-for-W" class="anchor">§</a><h3 class="code-header">impl&lt;W&gt; <a class="trait" href="../io/trait.AsyncWriteExt.html" title="trait tokio::io::AsyncWriteExt">AsyncWriteExt</a> for W<div class="where">where
W: <a class="trait" href="../io/trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite">AsyncWrite</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.write" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_write_ext.rs.html#130-135">Source</a><a href="#method.write" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncWriteExt.html#method.write" class="fn">write</a>&lt;'a&gt;(&amp;'a mut self, src: &amp;'a [<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>]) -&gt; Write&lt;'a, Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Writes a buffer into this writer, returning how many bytes were
written. <a href="../io/trait.AsyncWriteExt.html#method.write">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.write_vectored" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_write_ext.rs.html#182-187">Source</a><a href="#method.write_vectored" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncWriteExt.html#method.write_vectored" class="fn">write_vectored</a>&lt;'a, 'b&gt;(
&amp;'a mut self,
bufs: &amp;'a [<a class="struct" href="https://doc.rust-lang.org/1.93.1/std/io/struct.IoSlice.html" title="struct std::io::IoSlice">IoSlice</a>&lt;'b&gt;],
) -&gt; WriteVectored&lt;'a, 'b, Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Like <a href="../io/trait.AsyncWriteExt.html#method.write" title="method tokio::io::AsyncWriteExt::write"><code>write</code></a>, except that it writes from a slice of buffers. <a href="../io/trait.AsyncWriteExt.html#method.write_vectored">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.write_buf" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_write_ext.rs.html#266-272">Source</a><a href="#method.write_buf" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncWriteExt.html#method.write_buf" class="fn">write_buf</a>&lt;'a, B&gt;(&amp;'a mut self, src: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;'a mut B</a>) -&gt; WriteBuf&lt;'a, Self, B&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,
B: <a class="trait" href="../../bytes/buf/buf_impl/trait.Buf.html" title="trait bytes::buf::buf_impl::Buf">Buf</a>,</div></h4></section></summary><div class='docblock'>Writes a buffer into this writer, advancing the buffers internal
cursor. <a href="../io/trait.AsyncWriteExt.html#method.write_buf">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.write_all_buf" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_write_ext.rs.html#334-340">Source</a><a href="#method.write_all_buf" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncWriteExt.html#method.write_all_buf" class="fn">write_all_buf</a>&lt;'a, B&gt;(
&amp;'a mut self,
src: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;'a mut B</a>,
) -&gt; WriteAllBuf&lt;'a, Self, B&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,
B: <a class="trait" href="../../bytes/buf/buf_impl/trait.Buf.html" title="trait bytes::buf::buf_impl::Buf">Buf</a>,</div></h4></section></summary><div class='docblock'>Attempts to write an entire buffer into this writer. <a href="../io/trait.AsyncWriteExt.html#method.write_all_buf">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.write_all" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_write_ext.rs.html#387-392">Source</a><a href="#method.write_all" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncWriteExt.html#method.write_all" class="fn">write_all</a>&lt;'a&gt;(&amp;'a mut self, src: &amp;'a [<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>]) -&gt; WriteAll&lt;'a, Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Attempts to write an entire buffer into this writer. <a href="../io/trait.AsyncWriteExt.html#method.write_all">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.write_u8" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_write_ext.rs.html#394-1236">Source</a><a href="#method.write_u8" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncWriteExt.html#method.write_u8" class="fn">write_u8</a>(&amp;mut self, n: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>) -&gt; WriteU8&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Writes an unsigned 8-bit integer to the underlying writer. <a href="../io/trait.AsyncWriteExt.html#method.write_u8">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.write_i8" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_write_ext.rs.html#394-1236">Source</a><a href="#method.write_i8" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncWriteExt.html#method.write_i8" class="fn">write_i8</a>(&amp;mut self, n: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i8.html">i8</a>) -&gt; WriteI8&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Writes a signed 8-bit integer to the underlying writer. <a href="../io/trait.AsyncWriteExt.html#method.write_i8">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.write_u16" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_write_ext.rs.html#394-1236">Source</a><a href="#method.write_u16" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncWriteExt.html#method.write_u16" class="fn">write_u16</a>(&amp;mut self, n: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u16.html">u16</a>) -&gt; WriteU16&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Writes an unsigned 16-bit integer in big-endian order to the
underlying writer. <a href="../io/trait.AsyncWriteExt.html#method.write_u16">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.write_i16" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_write_ext.rs.html#394-1236">Source</a><a href="#method.write_i16" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncWriteExt.html#method.write_i16" class="fn">write_i16</a>(&amp;mut self, n: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i16.html">i16</a>) -&gt; WriteI16&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Writes a signed 16-bit integer in big-endian order to the
underlying writer. <a href="../io/trait.AsyncWriteExt.html#method.write_i16">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.write_u32" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_write_ext.rs.html#394-1236">Source</a><a href="#method.write_u32" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncWriteExt.html#method.write_u32" class="fn">write_u32</a>(&amp;mut self, n: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u32.html">u32</a>) -&gt; WriteU32&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Writes an unsigned 32-bit integer in big-endian order to the
underlying writer. <a href="../io/trait.AsyncWriteExt.html#method.write_u32">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.write_i32" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_write_ext.rs.html#394-1236">Source</a><a href="#method.write_i32" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncWriteExt.html#method.write_i32" class="fn">write_i32</a>(&amp;mut self, n: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i32.html">i32</a>) -&gt; WriteI32&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Writes a signed 32-bit integer in big-endian order to the
underlying writer. <a href="../io/trait.AsyncWriteExt.html#method.write_i32">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.write_u64" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_write_ext.rs.html#394-1236">Source</a><a href="#method.write_u64" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncWriteExt.html#method.write_u64" class="fn">write_u64</a>(&amp;mut self, n: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a>) -&gt; WriteU64&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Writes an unsigned 64-bit integer in big-endian order to the
underlying writer. <a href="../io/trait.AsyncWriteExt.html#method.write_u64">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.write_i64" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_write_ext.rs.html#394-1236">Source</a><a href="#method.write_i64" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncWriteExt.html#method.write_i64" class="fn">write_i64</a>(&amp;mut self, n: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i64.html">i64</a>) -&gt; WriteI64&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Writes an signed 64-bit integer in big-endian order to the
underlying writer. <a href="../io/trait.AsyncWriteExt.html#method.write_i64">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.write_u128" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_write_ext.rs.html#394-1236">Source</a><a href="#method.write_u128" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncWriteExt.html#method.write_u128" class="fn">write_u128</a>(&amp;mut self, n: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u128.html">u128</a>) -&gt; WriteU128&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Writes an unsigned 128-bit integer in big-endian order to the
underlying writer. <a href="../io/trait.AsyncWriteExt.html#method.write_u128">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.write_i128" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_write_ext.rs.html#394-1236">Source</a><a href="#method.write_i128" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncWriteExt.html#method.write_i128" class="fn">write_i128</a>(&amp;mut self, n: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i128.html">i128</a>) -&gt; WriteI128&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Writes an signed 128-bit integer in big-endian order to the
underlying writer. <a href="../io/trait.AsyncWriteExt.html#method.write_i128">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.write_f32" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_write_ext.rs.html#394-1236">Source</a><a href="#method.write_f32" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncWriteExt.html#method.write_f32" class="fn">write_f32</a>(&amp;mut self, n: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f32.html">f32</a>) -&gt; WriteF32&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Writes an 32-bit floating point type in big-endian order to the
underlying writer. <a href="../io/trait.AsyncWriteExt.html#method.write_f32">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.write_f64" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_write_ext.rs.html#394-1236">Source</a><a href="#method.write_f64" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncWriteExt.html#method.write_f64" class="fn">write_f64</a>(&amp;mut self, n: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f64.html">f64</a>) -&gt; WriteF64&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Writes an 64-bit floating point type in big-endian order to the
underlying writer. <a href="../io/trait.AsyncWriteExt.html#method.write_f64">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.write_u16_le" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_write_ext.rs.html#394-1236">Source</a><a href="#method.write_u16_le" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncWriteExt.html#method.write_u16_le" class="fn">write_u16_le</a>(&amp;mut self, n: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u16.html">u16</a>) -&gt; WriteU16Le&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Writes an unsigned 16-bit integer in little-endian order to the
underlying writer. <a href="../io/trait.AsyncWriteExt.html#method.write_u16_le">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.write_i16_le" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_write_ext.rs.html#394-1236">Source</a><a href="#method.write_i16_le" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncWriteExt.html#method.write_i16_le" class="fn">write_i16_le</a>(&amp;mut self, n: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i16.html">i16</a>) -&gt; WriteI16Le&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Writes a signed 16-bit integer in little-endian order to the
underlying writer. <a href="../io/trait.AsyncWriteExt.html#method.write_i16_le">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.write_u32_le" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_write_ext.rs.html#394-1236">Source</a><a href="#method.write_u32_le" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncWriteExt.html#method.write_u32_le" class="fn">write_u32_le</a>(&amp;mut self, n: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u32.html">u32</a>) -&gt; WriteU32Le&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Writes an unsigned 32-bit integer in little-endian order to the
underlying writer. <a href="../io/trait.AsyncWriteExt.html#method.write_u32_le">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.write_i32_le" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_write_ext.rs.html#394-1236">Source</a><a href="#method.write_i32_le" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncWriteExt.html#method.write_i32_le" class="fn">write_i32_le</a>(&amp;mut self, n: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i32.html">i32</a>) -&gt; WriteI32Le&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Writes a signed 32-bit integer in little-endian order to the
underlying writer. <a href="../io/trait.AsyncWriteExt.html#method.write_i32_le">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.write_u64_le" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_write_ext.rs.html#394-1236">Source</a><a href="#method.write_u64_le" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncWriteExt.html#method.write_u64_le" class="fn">write_u64_le</a>(&amp;mut self, n: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a>) -&gt; WriteU64Le&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Writes an unsigned 64-bit integer in little-endian order to the
underlying writer. <a href="../io/trait.AsyncWriteExt.html#method.write_u64_le">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.write_i64_le" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_write_ext.rs.html#394-1236">Source</a><a href="#method.write_i64_le" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncWriteExt.html#method.write_i64_le" class="fn">write_i64_le</a>(&amp;mut self, n: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i64.html">i64</a>) -&gt; WriteI64Le&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Writes an signed 64-bit integer in little-endian order to the
underlying writer. <a href="../io/trait.AsyncWriteExt.html#method.write_i64_le">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.write_u128_le" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_write_ext.rs.html#394-1236">Source</a><a href="#method.write_u128_le" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncWriteExt.html#method.write_u128_le" class="fn">write_u128_le</a>(&amp;mut self, n: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u128.html">u128</a>) -&gt; WriteU128Le&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Writes an unsigned 128-bit integer in little-endian order to the
underlying writer. <a href="../io/trait.AsyncWriteExt.html#method.write_u128_le">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.write_i128_le" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_write_ext.rs.html#394-1236">Source</a><a href="#method.write_i128_le" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncWriteExt.html#method.write_i128_le" class="fn">write_i128_le</a>(&amp;mut self, n: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i128.html">i128</a>) -&gt; WriteI128Le&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Writes an signed 128-bit integer in little-endian order to the
underlying writer. <a href="../io/trait.AsyncWriteExt.html#method.write_i128_le">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.write_f32_le" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_write_ext.rs.html#394-1236">Source</a><a href="#method.write_f32_le" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncWriteExt.html#method.write_f32_le" class="fn">write_f32_le</a>(&amp;mut self, n: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f32.html">f32</a>) -&gt; WriteF32Le&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Writes an 32-bit floating point type in little-endian order to the
underlying writer. <a href="../io/trait.AsyncWriteExt.html#method.write_f32_le">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.write_f64_le" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_write_ext.rs.html#394-1236">Source</a><a href="#method.write_f64_le" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncWriteExt.html#method.write_f64_le" class="fn">write_f64_le</a>(&amp;mut self, n: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.f64.html">f64</a>) -&gt; WriteF64Le&lt;&amp;mut Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Writes an 64-bit floating point type in little-endian order to the
underlying writer. <a href="../io/trait.AsyncWriteExt.html#method.write_f64_le">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.flush" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_write_ext.rs.html#1281-1286">Source</a><a href="#method.flush" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncWriteExt.html#method.flush" class="fn">flush</a>(&amp;mut self) -&gt; Flush&lt;'_, Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Flushes this output stream, ensuring that all intermediately buffered
contents reach their destination. <a href="../io/trait.AsyncWriteExt.html#method.flush">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.shutdown" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/util/async_write_ext.rs.html#1323-1328">Source</a><a href="#method.shutdown" class="anchor">§</a><h4 class="code-header">fn <a href="../io/trait.AsyncWriteExt.html#method.shutdown" class="fn">shutdown</a>(&amp;mut self) -&gt; Shutdown&lt;'_, Self&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h4></section></summary><div class='docblock'>Shuts down the output stream, ensuring that the value can be dropped
cleanly. <a href="../io/trait.AsyncWriteExt.html#method.shutdown">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/borrow.rs.html#212">Source</a><a href="#impl-Borrow%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T<div class="where">where
T: ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/borrow.rs.html#214">Source</a><a href="#method.borrow" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/borrow/trait.Borrow.html#tymethod.borrow" class="fn">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;T</a></h4></section></summary><div class='docblock'>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.93.1/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/borrow.rs.html#221">Source</a><a href="#impl-BorrowMut%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T<div class="where">where
T: ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/borrow.rs.html#222">Source</a><a href="#method.borrow_mut" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fn">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;mut T</a></h4></section></summary><div class='docblock'>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.93.1/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-From%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/convert/mod.rs.html#785">Source</a><a href="#impl-From%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/convert/mod.rs.html#788">Source</a><a href="#method.from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(t: T) -&gt; T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/convert/mod.rs.html#767-769">Source</a><a href="#impl-Into%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T<div class="where">where
U: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/convert/mod.rs.html#777">Source</a><a href="#method.into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.Into.html#tymethod.into" class="fn">into</a>(self) -&gt; U</h4></section></summary><div class="docblock"><p>Calls <code>U::from(self)</code>.</p>
<p>That is, this conversion is whatever the implementation of
<code><a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for U</code> chooses to do.</p>
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/convert/mod.rs.html#827-829">Source</a><a href="#impl-TryFrom%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T<div class="where">where
U: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-2" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/convert/mod.rs.html#831">Source</a><a href="#associatedtype.Error-2" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from-1" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/convert/mod.rs.html#834">Source</a><a href="#method.try_from-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/convert/mod.rs.html#811-813">Source</a><a href="#impl-TryInto%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T<div class="where">where
U: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-1" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/convert/mod.rs.html#815">Source</a><a href="#associatedtype.Error-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/convert/mod.rs.html#818">Source</a><a href="#method.try_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryInto.html#tymethod.try_into" class="fn">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details></div></section></div></main></body></html>