Adding large folders

This commit is contained in:
2026-02-26 12:00:21 -05:00
parent 5400d82acd
commit 49701c85ad
47332 changed files with 1942573 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tokio/io/trait.AsyncBufRead.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tokio/io/trait.AsyncBufRead.html">../../../tokio/io/trait.AsyncBufRead.html</a>...</p>
<script>location.replace("../../../tokio/io/trait.AsyncBufRead.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tokio/io/unix/struct.AsyncFd.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tokio/io/unix/struct.AsyncFd.html">../../../tokio/io/unix/struct.AsyncFd.html</a>...</p>
<script>location.replace("../../../tokio/io/unix/struct.AsyncFd.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tokio/io/unix/struct.AsyncFdReadyGuard.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tokio/io/unix/struct.AsyncFdReadyGuard.html">../../../tokio/io/unix/struct.AsyncFdReadyGuard.html</a>...</p>
<script>location.replace("../../../tokio/io/unix/struct.AsyncFdReadyGuard.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tokio/io/unix/struct.AsyncFdReadyMutGuard.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tokio/io/unix/struct.AsyncFdReadyMutGuard.html">../../../tokio/io/unix/struct.AsyncFdReadyMutGuard.html</a>...</p>
<script>location.replace("../../../tokio/io/unix/struct.AsyncFdReadyMutGuard.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tokio/io/unix/struct.AsyncFdTryNewError.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tokio/io/unix/struct.AsyncFdTryNewError.html">../../../tokio/io/unix/struct.AsyncFdTryNewError.html</a>...</p>
<script>location.replace("../../../tokio/io/unix/struct.AsyncFdTryNewError.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tokio/io/unix/struct.TryIoError.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tokio/io/unix/struct.TryIoError.html">../../../tokio/io/unix/struct.TryIoError.html</a>...</p>
<script>location.replace("../../../tokio/io/unix/struct.TryIoError.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tokio/io/trait.AsyncRead.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tokio/io/trait.AsyncRead.html">../../../tokio/io/trait.AsyncRead.html</a>...</p>
<script>location.replace("../../../tokio/io/trait.AsyncRead.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tokio/io/trait.AsyncSeek.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tokio/io/trait.AsyncSeek.html">../../../tokio/io/trait.AsyncSeek.html</a>...</p>
<script>location.replace("../../../tokio/io/trait.AsyncSeek.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tokio/io/trait.AsyncWrite.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tokio/io/trait.AsyncWrite.html">../../../tokio/io/trait.AsyncWrite.html</a>...</p>
<script>location.replace("../../../tokio/io/trait.AsyncWrite.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,30 @@
<!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="Asynchronously copies the entire contents of a reader into a writer."><title>copy in tokio::io - 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 fn"><!--[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="#">copy</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="#">copy</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#when-to-use-async-alternatives-instead-of-synciobridge" title="When to use async alternatives instead of `SyncIoBridge`">When to use async alternatives instead of <code>SyncIoBridge</code></a></li><li><a href="#errors" title="Errors">Errors</a></li><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>io</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">io</a></div><h1>Function <span class="fn">copy</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/io/util/copy.rs.html#277-287">Source</a> </span></div><pre class="rust item-decl"><code>pub async fn copy&lt;'a, R, W&gt;(reader: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;'a mut R</a>, writer: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;'a mut W</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.u64.html">u64</a>&gt;<div class="where">where
R: <a class="trait" href="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.Unpin.html" title="trait core::marker::Unpin">Unpin</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>,
W: <a class="trait" href="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.Unpin.html" title="trait core::marker::Unpin">Unpin</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></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Asynchronously copies the entire contents of a reader into a writer.</p>
<p>This function returns a future that will continuously read data from
<code>reader</code> and then write it into <code>writer</code> in a streaming fashion until
<code>reader</code> returns EOF or fails.</p>
<p>On success, the total number of bytes that were copied from <code>reader</code> to
<code>writer</code> is returned.</p>
<p>This is an asynchronous version of <a href="https://doc.rust-lang.org/1.93.1/std/io/copy/fn.copy.html" title="fn std::io::copy::copy"><code>std::io::copy</code></a>.</p>
<p>A heap-allocated copy buffer with 8 KB is created to take data from the
reader to the writer, check <a href="fn.copy_buf.html" title="fn tokio::io::copy_buf"><code>copy_buf</code></a> if you want an alternative for
<a href="trait.AsyncBufRead.html" title="trait tokio::io::AsyncBufRead"><code>AsyncBufRead</code></a>. You can use <code>copy_buf</code> with <a href="struct.BufReader.html" title="struct tokio::io::BufReader"><code>BufReader</code></a> to change the
buffer capacity.</p>
<h2 id="when-to-use-async-alternatives-instead-of-synciobridge"><a class="doc-anchor" href="#when-to-use-async-alternatives-instead-of-synciobridge">§</a>When to use async alternatives instead of <code>SyncIoBridge</code></h2>
<p>If you are looking to use <a href="https://doc.rust-lang.org/1.93.1/std/io/copy/fn.copy.html" title="fn std::io::copy::copy"><code>std::io::copy</code></a> with a synchronous consumer
(like a <code>hasher</code> or compressor), consider using async alternatives instead of
wrapping the reader with <a href="https://docs.rs/tokio-util/latest/tokio_util/io/struct.SyncIoBridge.html"><code>SyncIoBridge</code></a>.
See the <a href="https://docs.rs/tokio-util/latest/tokio_util/io/struct.SyncIoBridge.html"><code>SyncIoBridge</code></a> documentation for detailed examples and guidance.</p>
<h2 id="errors"><a class="doc-anchor" href="#errors">§</a>Errors</h2>
<p>The returned future will return an error immediately if any call to
<code>poll_read</code> or <code>poll_write</code> returns an error.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::io;
<span class="kw">let </span><span class="kw-2">mut </span>reader: <span class="kw-2">&amp;</span>[u8] = <span class="string">b"hello"</span>;
<span class="kw">let </span><span class="kw-2">mut </span>writer: Vec&lt;u8&gt; = <span class="macro">vec!</span>[];
io::copy(<span class="kw-2">&amp;mut </span>reader, <span class="kw-2">&amp;mut </span>writer).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="macro">assert_eq!</span>(<span class="kw-2">&amp;</span><span class="string">b"hello"</span>[..], <span class="kw-2">&amp;</span>writer[..]);</code></pre></div></div></details></section></div></main></body></html>

View File

@@ -0,0 +1,26 @@
<!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="Copies data in both directions between `a` and `b`."><title>copy_bidirectional in tokio::io - 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 fn"><!--[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="#">copy_bidirectional</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="#">copy_<wbr>bidirectional</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#errors" title="Errors">Errors</a></li><li><a href="#return-value" title="Return value">Return value</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>io</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">io</a></div><h1>Function <span class="fn">copy_<wbr>bidirectional</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/io/util/copy_bidirectional.rs.html#75-87">Source</a> </span></div><pre class="rust item-decl"><code>pub async fn copy_bidirectional&lt;A, B&gt;(
a: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;mut A</a>,
b: <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.u64.html">u64</a>, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a>)&gt;<div class="where">where
A: <a class="trait" href="trait.AsyncRead.html" title="trait tokio::io::AsyncRead">AsyncRead</a> + <a class="trait" href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite">AsyncWrite</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</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>,
B: <a class="trait" href="trait.AsyncRead.html" title="trait tokio::io::AsyncRead">AsyncRead</a> + <a class="trait" href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite">AsyncWrite</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</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></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Copies data in both directions between <code>a</code> and <code>b</code>.</p>
<p>This function returns a future that will read from both streams,
writing any data read to the opposing stream.
This happens in both directions concurrently.</p>
<p>If an EOF is observed on one stream, <a href="trait.AsyncWriteExt.html#method.shutdown" title="method tokio::io::AsyncWriteExt::shutdown"><code>shutdown()</code></a> will be invoked on
the other, and reading from that stream will stop. Copying of data in
the other direction will continue.</p>
<p>The future will complete successfully once both directions of communication has been shut down.
A direction is shut down when the reader reports EOF,
at which point <a href="trait.AsyncWriteExt.html#method.shutdown" title="method tokio::io::AsyncWriteExt::shutdown"><code>shutdown()</code></a> is called on the corresponding writer. When finished,
it will return a tuple of the number of bytes copied from a to b
and the number of bytes copied from b to a, in that order.</p>
<p>It uses two 8 KB buffers for transferring bytes between <code>a</code> and <code>b</code> by default.
To set your own buffers sizes use <a href="fn.copy_bidirectional_with_sizes.html" title="fn tokio::io::copy_bidirectional_with_sizes"><code>copy_bidirectional_with_sizes()</code></a>.</p>
<h2 id="errors"><a class="doc-anchor" href="#errors">§</a>Errors</h2>
<p>The future will immediately return an error if any IO operation on <code>a</code>
or <code>b</code> returns an error. Some data read from either stream may be lost (not
written to the other stream) in this case.</p>
<h2 id="return-value"><a class="doc-anchor" href="#return-value">§</a>Return value</h2>
<p>Returns a tuple of bytes copied <code>a</code> to <code>b</code> and bytes copied <code>b</code> to <code>a</code>.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,11 @@
<!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="Copies data in both directions between `a` and `b` using buffers of the specified size."><title>copy_bidirectional_with_sizes in tokio::io - 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 fn"><!--[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="#">copy_bidirectional_with_sizes</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"><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>io</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">io</a></div><h1>Function <span class="fn">copy_<wbr>bidirectional_<wbr>with_<wbr>sizes</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/io/util/copy_bidirectional.rs.html#94-111">Source</a> </span></div><pre class="rust item-decl"><code>pub async fn copy_bidirectional_with_sizes&lt;A, B&gt;(
a: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;mut A</a>,
b: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;mut B</a>,
a_to_b_buf_size: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>,
b_to_a_buf_size: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</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.u64.html">u64</a>, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a>)&gt;<div class="where">where
A: <a class="trait" href="trait.AsyncRead.html" title="trait tokio::io::AsyncRead">AsyncRead</a> + <a class="trait" href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite">AsyncWrite</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</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>,
B: <a class="trait" href="trait.AsyncRead.html" title="trait tokio::io::AsyncRead">AsyncRead</a> + <a class="trait" href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite">AsyncWrite</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</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></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Copies data in both directions between <code>a</code> and <code>b</code> using buffers of the specified size.</p>
<p>This method is the same as the <a href="fn.copy_bidirectional.html" title="fn tokio::io::copy_bidirectional"><code>copy_bidirectional()</code></a>, except that it allows you to set the
size of the internal buffers used when copying data.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,33 @@
<!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="Asynchronously copies the entire contents of a reader into a writer."><title>copy_buf in tokio::io - 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 fn"><!--[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="#">copy_buf</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="#">copy_<wbr>buf</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#when-to-use-async-alternatives-instead-of-synciobridge" title="When to use async alternatives instead of `SyncIoBridge`">When to use async alternatives instead of <code>SyncIoBridge</code></a></li><li><a href="#errors" title="Errors">Errors</a></li><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>io</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">io</a></div><h1>Function <span class="fn">copy_<wbr>buf</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/io/util/copy_buf.rs.html#69-79">Source</a> </span></div><pre class="rust item-decl"><code>pub async fn copy_buf&lt;'a, R, W&gt;(
reader: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;'a mut R</a>,
writer: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;'a mut W</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.u64.html">u64</a>&gt;<div class="where">where
R: <a class="trait" href="trait.AsyncBufRead.html" title="trait tokio::io::AsyncBufRead">AsyncBufRead</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> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
W: <a class="trait" href="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.Unpin.html" title="trait core::marker::Unpin">Unpin</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></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Asynchronously copies the entire contents of a reader into a writer.</p>
<p>This function returns a future that will continuously read data from
<code>reader</code> and then write it into <code>writer</code> in a streaming fashion until
<code>reader</code> returns EOF or fails.</p>
<p>On success, the total number of bytes that were copied from <code>reader</code> to
<code>writer</code> is returned.</p>
<p>This is a <a href="fn.copy.html" title="fn tokio::io::copy"><code>tokio::io::copy</code></a> alternative for <a href="trait.AsyncBufRead.html" title="trait tokio::io::AsyncBufRead"><code>AsyncBufRead</code></a> readers
with no extra buffer allocation, since <a href="trait.AsyncBufRead.html" title="trait tokio::io::AsyncBufRead"><code>AsyncBufRead</code></a> allow access
to the readers inner buffer.</p>
<h2 id="when-to-use-async-alternatives-instead-of-synciobridge"><a class="doc-anchor" href="#when-to-use-async-alternatives-instead-of-synciobridge">§</a>When to use async alternatives instead of <code>SyncIoBridge</code></h2>
<p>If you are looking to use <a href="https://doc.rust-lang.org/1.93.1/std/io/copy/fn.copy.html" title="fn std::io::copy::copy"><code>std::io::copy</code></a> with a synchronous consumer
(like a <code>hasher</code> or compressor), consider using async alternatives instead of
wrapping the reader with <a href="https://docs.rs/tokio-util/latest/tokio_util/io/struct.SyncIoBridge.html"><code>SyncIoBridge</code></a>. See the <a href="https://docs.rs/tokio-util/latest/tokio_util/io/struct.SyncIoBridge.html"><code>SyncIoBridge</code></a>
documentation for detailed examples and guidance on hashing, compression,
and data parsing.</p>
<h2 id="errors"><a class="doc-anchor" href="#errors">§</a>Errors</h2>
<p>The returned future will finish with an error will return an error
immediately if any call to <code>poll_fill_buf</code> or <code>poll_write</code> returns an
error.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::io;
<span class="kw">let </span><span class="kw-2">mut </span>reader: <span class="kw-2">&amp;</span>[u8] = <span class="string">b"hello"</span>;
<span class="kw">let </span><span class="kw-2">mut </span>writer: Vec&lt;u8&gt; = <span class="macro">vec!</span>[];
io::copy_buf(<span class="kw-2">&amp;mut </span>reader, <span class="kw-2">&amp;mut </span>writer).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="macro">assert_eq!</span>(<span class="string">b"hello"</span>, <span class="kw-2">&amp;</span>writer[..]);</code></pre></div></div></details></section></div></main></body></html>

View File

@@ -0,0 +1,4 @@
<!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="Create a new pair of `DuplexStream`s that act like a pair of connected sockets."><title>duplex in tokio::io - 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 fn"><!--[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="#">duplex</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"><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>io</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">io</a></div><h1>Function <span class="fn">duplex</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/io/util/mem.rs.html#104-118">Source</a> </span></div><pre class="rust item-decl"><code>pub fn duplex(max_buf_size: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -&gt; (<a class="struct" href="struct.DuplexStream.html" title="struct tokio::io::DuplexStream">DuplexStream</a>, <a class="struct" href="struct.DuplexStream.html" title="struct tokio::io::DuplexStream">DuplexStream</a>)</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Create a new pair of <code>DuplexStream</code>s that act like a pair of connected sockets.</p>
<p>The <code>max_buf_size</code> argument is the maximum amount of bytes that can be
written to a side before the write returns <code>Poll::Pending</code>.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,20 @@
<!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="Creates a value that is always at EOF for reads, and ignores all data written."><title>empty in tokio::io - 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 fn"><!--[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="#">empty</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="#">empty</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>io</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">io</a></div><h1>Function <span class="fn">empty</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/io/util/empty.rs.html#62-64">Source</a> </span></div><pre class="rust item-decl"><code>pub fn empty() -&gt; <a class="struct" href="struct.Empty.html" title="struct tokio::io::Empty">Empty</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Creates a value that is always at EOF for reads, and ignores all data written.</p>
<p>All writes on the returned instance will return <code>Poll::Ready(Ok(buf.len()))</code>
and the contents of the buffer will not be inspected.</p>
<p>All reads from the returned instance will return <code>Poll::Ready(Ok(0))</code>.</p>
<p>This is an asynchronous version of <a href="https://doc.rust-lang.org/1.93.1/std/io/util/fn.empty.html" title="fn std::io::util::empty"><code>std::io::empty</code></a>.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<p>A slightly sad example of not reading anything into a buffer:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::io::{<span class="self">self</span>, AsyncReadExt};
<span class="kw">let </span><span class="kw-2">mut </span>buffer = String::new();
io::empty().read_to_string(<span class="kw-2">&amp;mut </span>buffer).<span class="kw">await</span>.unwrap();
<span class="macro">assert!</span>(buffer.is_empty());</code></pre></div>
<p>A convoluted way of getting the length of a buffer:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::io::{<span class="self">self</span>, AsyncWriteExt};
<span class="kw">let </span>buffer = <span class="macro">vec!</span>[<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">5</span>, <span class="number">8</span>];
<span class="kw">let </span>num_bytes = io::empty().write(<span class="kw-2">&amp;</span>buffer).<span class="kw">await</span>.unwrap();
<span class="macro">assert_eq!</span>(num_bytes, <span class="number">5</span>);</code></pre></div></div></details></section></div></main></body></html>

View File

@@ -0,0 +1,5 @@
<!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="Join two values implementing `AsyncRead` and `AsyncWrite` into a single handle."><title>join in tokio::io - 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 fn"><!--[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="#">join</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"><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>io</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">io</a></div><h1>Function <span class="fn">join</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/io/join.rs.html#11-17">Source</a> </span></div><pre class="rust item-decl"><code>pub fn join&lt;R, W&gt;(reader: R, writer: W) -&gt; <a class="struct" href="struct.Join.html" title="struct tokio::io::Join">Join</a>&lt;R, W&gt;<div class="where">where
R: <a class="trait" href="trait.AsyncRead.html" title="trait tokio::io::AsyncRead">AsyncRead</a>,
W: <a class="trait" href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite">AsyncWrite</a>,</div></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Join two values implementing <code>AsyncRead</code> and <code>AsyncWrite</code> into a
single handle.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,10 @@
<!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="Creates an instance of an async reader that infinitely repeats one byte."><title>repeat in tokio::io - 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 fn"><!--[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="#">repeat</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="#">repeat</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>io</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">io</a></div><h1>Function <span class="fn">repeat</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/io/util/repeat.rs.html#47-49">Source</a> </span></div><pre class="rust item-decl"><code>pub fn repeat(byte: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>) -&gt; <a class="struct" href="struct.Repeat.html" title="struct tokio::io::Repeat">Repeat</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Creates an instance of an async reader that infinitely repeats one byte.</p>
<p>All reads from this reader will succeed by filling the specified buffer with
the given byte.</p>
<p>This is an asynchronous version of <a href="https://doc.rust-lang.org/1.93.1/std/io/util/fn.repeat.html" title="fn std::io::util::repeat"><code>std::io::repeat</code></a>.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::io::{<span class="self">self</span>, AsyncReadExt};
<span class="kw">let </span><span class="kw-2">mut </span>buffer = [<span class="number">0</span>; <span class="number">3</span>];
io::repeat(<span class="number">0b101</span>).read_exact(<span class="kw-2">&amp;mut </span>buffer).<span class="kw">await</span>.unwrap();
<span class="macro">assert_eq!</span>(buffer, [<span class="number">0b101</span>, <span class="number">0b101</span>, <span class="number">0b101</span>]);</code></pre></div></div></details></section></div></main></body></html>

View File

@@ -0,0 +1,18 @@
<!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="Creates unidirectional buffer that acts like in memory pipe."><title>simplex in tokio::io - 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 fn"><!--[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="#">simplex</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="#">simplex</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#unify-reader-and-writer" title="Unify reader and writer">Unify reader and writer</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>io</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">io</a></div><h1>Function <span class="fn">simplex</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/io/util/mem.rs.html#211-213">Source</a> </span></div><pre class="rust item-decl"><code>pub fn simplex(
max_buf_size: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>,
) -&gt; (<a class="struct" href="struct.ReadHalf.html" title="struct tokio::io::ReadHalf">ReadHalf</a>&lt;<a class="struct" href="struct.SimplexStream.html" title="struct tokio::io::SimplexStream">SimplexStream</a>&gt;, <a class="struct" href="struct.WriteHalf.html" title="struct tokio::io::WriteHalf">WriteHalf</a>&lt;<a class="struct" href="struct.SimplexStream.html" title="struct tokio::io::SimplexStream">SimplexStream</a>&gt;)</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Creates unidirectional buffer that acts like in memory pipe.</p>
<p>The <code>max_buf_size</code> argument is the maximum amount of bytes that can be
written to a buffer before the it returns <code>Poll::Pending</code>.</p>
<h2 id="unify-reader-and-writer"><a class="doc-anchor" href="#unify-reader-and-writer">§</a>Unify reader and writer</h2>
<p>The reader and writer half can be unified into a single structure
of <code>SimplexStream</code> that supports both reading and writing or
the <code>SimplexStream</code> can be already created as unified structure
using <a href="struct.SimplexStream.html#method.new_unsplit" title="associated function tokio::io::SimplexStream::new_unsplit"><code>SimplexStream::new_unsplit()</code></a>.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>(reader, writer) = tokio::io::simplex(<span class="number">64</span>);
<span class="kw">let </span><span class="kw-2">mut </span>simplex_stream = reader.unsplit(writer);
simplex_stream.write_all(<span class="string">b"hello"</span>).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="kw">let </span><span class="kw-2">mut </span>buf = [<span class="number">0u8</span>; <span class="number">5</span>];
simplex_stream.read_exact(<span class="kw-2">&amp;mut </span>buf).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="macro">assert_eq!</span>(<span class="kw-2">&amp;</span>buf, <span class="string">b"hello"</span>);</code></pre></div></div></details></section></div></main></body></html>

View File

@@ -0,0 +1,13 @@
<!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="Creates an instance of an async writer which will successfully consume all data."><title>sink in tokio::io - 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 fn"><!--[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="#">sink</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="#">sink</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>io</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">io</a></div><h1>Function <span class="fn">sink</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/io/util/sink.rs.html#48-50">Source</a> </span></div><pre class="rust item-decl"><code>pub fn sink() -&gt; <a class="struct" href="struct.Sink.html" title="struct tokio::io::Sink">Sink</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Creates an instance of an async writer which will successfully consume all
data.</p>
<p>All calls to <a href="trait.AsyncWrite.html#tymethod.poll_write" title="method tokio::io::AsyncWrite::poll_write"><code>poll_write</code></a> on the returned instance will return
<code>Poll::Ready(Ok(buf.len()))</code> and the contents of the buffer will not be
inspected.</p>
<p>This is an asynchronous version of <a href="https://doc.rust-lang.org/1.93.1/std/io/util/fn.sink.html" title="fn std::io::util::sink"><code>std::io::sink</code></a>.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::io::{<span class="self">self</span>, AsyncWriteExt};
<span class="kw">let </span>buffer = <span class="macro">vec!</span>[<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">5</span>, <span class="number">8</span>];
<span class="kw">let </span>num_bytes = io::sink().write(<span class="kw-2">&amp;</span>buffer).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="macro">assert_eq!</span>(num_bytes, <span class="number">5</span>);
<span class="prelude-val">Ok</span>(())</code></pre></div></div></details></section></div></main></body></html>

View File

@@ -0,0 +1,6 @@
<!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="Splits a single value implementing `AsyncRead + AsyncWrite` into separate `AsyncRead` and `AsyncWrite` handles."><title>split in tokio::io - 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 fn"><!--[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="#">split</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"><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>io</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">io</a></div><h1>Function <span class="fn">split</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/io/split.rs.html#32-50">Source</a> </span></div><pre class="rust item-decl"><code>pub fn split&lt;T&gt;(stream: T) -&gt; (<a class="struct" href="struct.ReadHalf.html" title="struct tokio::io::ReadHalf">ReadHalf</a>&lt;T&gt;, <a class="struct" href="struct.WriteHalf.html" title="struct tokio::io::WriteHalf">WriteHalf</a>&lt;T&gt;)<div class="where">where
T: <a class="trait" href="trait.AsyncRead.html" title="trait tokio::io::AsyncRead">AsyncRead</a> + <a class="trait" href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite">AsyncWrite</a>,</div></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Splits a single value implementing <code>AsyncRead + AsyncWrite</code> into separate
<code>AsyncRead</code> and <code>AsyncWrite</code> handles.</p>
<p>To restore this read/write object from its <code>ReadHalf</code> and
<code>WriteHalf</code> use <a href="struct.ReadHalf.html#method.unsplit" title="method tokio::io::ReadHalf::unsplit"><code>unsplit</code></a>.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,17 @@
<!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="Constructs a new handle to the standard error of the current process."><title>stderr in tokio::io - 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 fn"><!--[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="#">stderr</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="#">stderr</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>io</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">io</a></div><h1>Function <span class="fn">stderr</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/io/stderr.rs.html#68-77">Source</a> </span></div><pre class="rust item-decl"><code>pub fn stderr() -&gt; <a class="struct" href="struct.Stderr.html" title="struct tokio::io::Stderr">Stderr</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Constructs a new handle to the standard error of the current process.</p>
<p>The returned handle allows writing to standard error from the within the
Tokio runtime.</p>
<p>Concurrent writes to stderr must be executed with care: Only individual
writes to this <a href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite"><code>AsyncWrite</code></a> are guaranteed to be intact. In particular
you should be aware that writes using <a href="trait.AsyncWriteExt.html#method.write_all" title="method tokio::io::AsyncWriteExt::write_all"><code>write_all</code></a> are not guaranteed
to occur as a single write, so multiple threads writing data with
<a href="trait.AsyncWriteExt.html#method.write_all" title="method tokio::io::AsyncWriteExt::write_all"><code>write_all</code></a> may result in interleaved output.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::io::{<span class="self">self</span>, AsyncWriteExt};
<span class="attr">#[tokio::main]
</span><span class="kw">async fn </span>main() -&gt; io::Result&lt;()&gt; {
<span class="kw">let </span><span class="kw-2">mut </span>stderr = io::stderr();
stderr.write_all(<span class="string">b"Print some error here."</span>).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="prelude-val">Ok</span>(())
}</code></pre></div></div></details></section></div></main></body></html>

View File

@@ -0,0 +1,9 @@
<!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="Constructs a new handle to the standard input of the current process."><title>stdin in tokio::io - 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 fn"><!--[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="#">stdin</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"><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>io</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">io</a></div><h1>Function <span class="fn">stdin</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/io/stdin.rs.html#43-52">Source</a> </span></div><pre class="rust item-decl"><code>pub fn stdin() -&gt; <a class="struct" href="struct.Stdin.html" title="struct tokio::io::Stdin">Stdin</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Constructs a new handle to the standard input of the current process.</p>
<p>This handle is best used for non-interactive uses, such as when a file
is piped into the application. For technical reasons, <code>stdin</code> is
implemented by using an ordinary blocking read on a separate thread, and
it is impossible to cancel that read. This can make shutdown of the
runtime hang until the user presses enter.</p>
<p>For interactive uses, it is recommended to spawn a thread dedicated to
user input and use blocking IO directly in that thread.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,39 @@
<!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="Constructs a new handle to the standard output of the current process."><title>stdout in tokio::io - 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 fn"><!--[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="#">stdout</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="#">stdout</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>io</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">io</a></div><h1>Function <span class="fn">stdout</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/io/stdout.rs.html#117-126">Source</a> </span></div><pre class="rust item-decl"><code>pub fn stdout() -&gt; <a class="struct" href="struct.Stdout.html" title="struct tokio::io::Stdout">Stdout</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Constructs a new handle to the standard output of the current process.</p>
<p>The returned handle allows writing to standard out from the within the
Tokio runtime.</p>
<p>Concurrent writes to stdout must be executed with care: Only individual
writes to this <a href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite"><code>AsyncWrite</code></a> are guaranteed to be intact. In particular
you should be aware that writes using <a href="trait.AsyncWriteExt.html#method.write_all" title="method tokio::io::AsyncWriteExt::write_all"><code>write_all</code></a> are not guaranteed
to occur as a single write, so multiple threads writing data with
<a href="trait.AsyncWriteExt.html#method.write_all" title="method tokio::io::AsyncWriteExt::write_all"><code>write_all</code></a> may result in interleaved output.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::io::{<span class="self">self</span>, AsyncWriteExt};
<span class="attr">#[tokio::main]
</span><span class="kw">async fn </span>main() -&gt; io::Result&lt;()&gt; {
<span class="kw">let </span><span class="kw-2">mut </span>stdout = io::stdout();
stdout.write_all(<span class="string">b"Hello world!"</span>).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="prelude-val">Ok</span>(())
}</code></pre></div>
<p>The following is an example of using <code>stdio</code> with loop.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::io::{<span class="self">self</span>, AsyncWriteExt};
<span class="attr">#[tokio::main]
</span><span class="kw">async fn </span>main() {
<span class="kw">let </span>messages = <span class="macro">vec!</span>[<span class="string">"hello"</span>, <span class="string">" world\n"</span>];
<span class="comment">// When you use `stdio` in a loop, it is recommended to create
// a single `stdio` instance outside the loop and call a write
// operation against that instance on each loop.
//
// Repeatedly creating `stdout` instances inside the loop and
// writing to that handle could result in mangled output since
// each write operation is handled by a different blocking thread.
</span><span class="kw">let </span><span class="kw-2">mut </span>stdout = io::stdout();
<span class="kw">for </span>message <span class="kw">in </span><span class="kw-2">&amp;</span>messages {
stdout.write_all(message.as_bytes()).<span class="kw">await</span>.unwrap();
stdout.flush().<span class="kw">await</span>.unwrap();
}
}</code></pre></div></div></details></section></div></main></body></html>

View File

@@ -0,0 +1,126 @@
<!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="Traits, helpers, and type definitions for asynchronous I/O functionality."><title>tokio::io - 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 mod"><!--[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="#">Module io</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="#">Module io</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#asyncread-and-asyncwrite" title="`AsyncRead` and `AsyncWrite`"><code>AsyncRead</code> and <code>AsyncWrite</code></a><ul><li><a href="#buffered-readers-and-writers" title="Buffered Readers and Writers">Buffered Readers and Writers</a></li><li><a href="#implementing-asyncread-and-asyncwrite" title="Implementing `AsyncRead` and `AsyncWrite`">Implementing <code>AsyncRead</code> and <code>AsyncWrite</code></a></li><li><a href="#conversion-to-and-from-streamsink" title="Conversion to and from Stream/Sink">Conversion to and from Stream/Sink</a></li></ul></li><li><a href="#standard-input-and-output" title="Standard input and output">Standard input and output</a></li><li><a href="#std-re-exports" title="`std` re-exports"><code>std</code> re-exports</a></li></ul><h3><a href="#reexports">Module Items</a></h3><ul class="block"><li><a href="#reexports" title="Re-exports">Re-exports</a></li><li><a href="#modules" title="Modules">Modules</a></li><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#traits" title="Traits">Traits</a></li><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate tokio</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></div><h1>Module <span>io</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/io/mod.rs.html#1-308">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Traits, helpers, and type definitions for asynchronous I/O functionality.</p>
<p>This module is the asynchronous version of <code>std::io</code>. Primarily, it
defines two traits, <a href="trait.AsyncRead.html" title="trait tokio::io::AsyncRead"><code>AsyncRead</code></a> and <a href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite"><code>AsyncWrite</code></a>, which are asynchronous
versions of the <a href="https://doc.rust-lang.org/1.93.1/std/io/trait.Read.html" title="trait std::io::Read"><code>Read</code></a> and <a href="https://doc.rust-lang.org/1.93.1/std/io/trait.Write.html" title="trait std::io::Write"><code>Write</code></a> traits in the standard library.</p>
<h2 id="asyncread-and-asyncwrite"><a class="doc-anchor" href="#asyncread-and-asyncwrite">§</a><code>AsyncRead</code> and <code>AsyncWrite</code></h2>
<p>Like the standard librarys <a href="https://doc.rust-lang.org/1.93.1/std/io/trait.Read.html" title="trait std::io::Read"><code>Read</code></a> and <a href="https://doc.rust-lang.org/1.93.1/std/io/trait.Write.html" title="trait std::io::Write"><code>Write</code></a> traits, <a href="trait.AsyncRead.html" title="trait tokio::io::AsyncRead"><code>AsyncRead</code></a> and
<a href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite"><code>AsyncWrite</code></a> provide the most general interface for reading and writing
input and output. Unlike the standard librarys traits, however, they are
<em>asynchronous</em> — meaning that reading from or writing to a <code>tokio::io</code>
type will <em>yield</em> to the Tokio scheduler when IO is not ready, rather than
blocking. This allows other tasks to run while waiting on IO.</p>
<p>Another difference is that <code>AsyncRead</code> and <code>AsyncWrite</code> only contain
core methods needed to provide asynchronous reading and writing
functionality. Instead, utility methods are defined in the <a href="trait.AsyncReadExt.html" title="trait tokio::io::AsyncReadExt"><code>AsyncReadExt</code></a>
and <a href="trait.AsyncWriteExt.html" title="trait tokio::io::AsyncWriteExt"><code>AsyncWriteExt</code></a> extension traits. These traits are automatically
implemented for all values that implement <code>AsyncRead</code> and <code>AsyncWrite</code>
respectively.</p>
<p>End users will rarely interact directly with <code>AsyncRead</code> and
<code>AsyncWrite</code>. Instead, they will use the async functions defined in the
extension traits. Library authors are expected to implement <code>AsyncRead</code>
and <code>AsyncWrite</code> in order to provide types that behave like byte streams.</p>
<p>Even with these differences, Tokios <code>AsyncRead</code> and <code>AsyncWrite</code> traits
can be used in almost exactly the same manner as the standard librarys
<code>Read</code> and <code>Write</code>. Most types in the standard library that implement <code>Read</code>
and <code>Write</code> have asynchronous equivalents in <code>tokio</code> that implement
<code>AsyncRead</code> and <code>AsyncWrite</code>, such as <a href="../fs/struct.File.html" title="struct tokio::fs::File"><code>File</code></a> and <a href="../net/struct.TcpStream.html" title="struct tokio::net::TcpStream"><code>TcpStream</code></a>.</p>
<p>For example, the standard library documentation introduces <code>Read</code> by
<a href="https://doc.rust-lang.org/1.93.1/std/io/index.html#read-and-write" title="mod std::io">demonstrating</a> reading some bytes from a <a href="https://doc.rust-lang.org/1.93.1/std/fs/struct.File.html" title="struct std::fs::File"><code>std::fs::File</code></a>. We
can do the same with <a href="../fs/struct.File.html" title="struct tokio::fs::File"><code>tokio::fs::File</code></a>:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::io::{<span class="self">self</span>, AsyncReadExt};
<span class="kw">use </span>tokio::fs::File;
<span class="attr">#[tokio::main]
</span><span class="kw">async fn </span>main() -&gt; io::Result&lt;()&gt; {
<span class="kw">let </span><span class="kw-2">mut </span>f = File::open(<span class="string">"foo.txt"</span>).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="kw">let </span><span class="kw-2">mut </span>buffer = [<span class="number">0</span>; <span class="number">10</span>];
<span class="comment">// read up to 10 bytes
</span><span class="kw">let </span>n = f.read(<span class="kw-2">&amp;mut </span>buffer).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="macro">println!</span>(<span class="string">"The bytes: {:?}"</span>, <span class="kw-2">&amp;</span>buffer[..n]);
<span class="prelude-val">Ok</span>(())
}</code></pre></div><h3 id="buffered-readers-and-writers"><a class="doc-anchor" href="#buffered-readers-and-writers">§</a>Buffered Readers and Writers</h3>
<p>Byte-based interfaces are unwieldy and can be inefficient, as wed need to be
making near-constant calls to the operating system. To help with this,
<code>std::io</code> comes with <a href="https://doc.rust-lang.org/1.93.1/std/io/index.html#bufreader-and-bufwriter" title="mod std::io">support for <em>buffered</em> readers and writers</a>,
and therefore, <code>tokio::io</code> does as well.</p>
<p>Tokio provides an async version of the <a href="https://doc.rust-lang.org/1.93.1/std/io/trait.BufRead.html" title="trait std::io::BufRead"><code>std::io::BufRead</code></a> trait,
<a href="trait.AsyncBufRead.html" title="trait tokio::io::AsyncBufRead"><code>AsyncBufRead</code></a>; and async <a href="struct.BufReader.html" title="struct tokio::io::BufReader"><code>BufReader</code></a> and <a href="struct.BufWriter.html" title="struct tokio::io::BufWriter"><code>BufWriter</code></a> structs, which
wrap readers and writers. These wrappers use a buffer, reducing the number
of calls and providing nicer methods for accessing exactly what you want.</p>
<p>For example, <a href="struct.BufReader.html" title="struct tokio::io::BufReader"><code>BufReader</code></a> works with the <a href="trait.AsyncBufRead.html" title="trait tokio::io::AsyncBufRead"><code>AsyncBufRead</code></a> trait to add
extra methods to any async reader:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::io::{<span class="self">self</span>, BufReader, AsyncBufReadExt};
<span class="kw">use </span>tokio::fs::File;
<span class="attr">#[tokio::main]
</span><span class="kw">async fn </span>main() -&gt; io::Result&lt;()&gt; {
<span class="kw">let </span>f = File::open(<span class="string">"foo.txt"</span>).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="kw">let </span><span class="kw-2">mut </span>reader = BufReader::new(f);
<span class="kw">let </span><span class="kw-2">mut </span>buffer = String::new();
<span class="comment">// read a line into buffer
</span>reader.read_line(<span class="kw-2">&amp;mut </span>buffer).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="macro">println!</span>(<span class="string">"{}"</span>, buffer);
<span class="prelude-val">Ok</span>(())
}</code></pre></div>
<p><a href="struct.BufWriter.html" title="struct tokio::io::BufWriter"><code>BufWriter</code></a> doesnt add any new ways of writing; it just buffers every call
to <a href="trait.AsyncWriteExt.html#method.write" title="method tokio::io::AsyncWriteExt::write"><code>write</code></a>. However, you <strong>must</strong> flush
<a href="struct.BufWriter.html" title="struct tokio::io::BufWriter"><code>BufWriter</code></a> to ensure that any buffered data is written.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::io::{<span class="self">self</span>, BufWriter, AsyncWriteExt};
<span class="kw">use </span>tokio::fs::File;
<span class="attr">#[tokio::main]
</span><span class="kw">async fn </span>main() -&gt; io::Result&lt;()&gt; {
<span class="kw">let </span>f = File::create(<span class="string">"foo.txt"</span>).<span class="kw">await</span><span class="question-mark">?</span>;
{
<span class="kw">let </span><span class="kw-2">mut </span>writer = BufWriter::new(f);
<span class="comment">// Write a byte to the buffer.
</span>writer.write(<span class="kw-2">&amp;</span>[<span class="number">42u8</span>]).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="comment">// Flush the buffer before it goes out of scope.
</span>writer.flush().<span class="kw">await</span><span class="question-mark">?</span>;
} <span class="comment">// Unless flushed or shut down, the contents of the buffer is discarded on drop.
</span><span class="prelude-val">Ok</span>(())
}</code></pre></div><h3 id="implementing-asyncread-and-asyncwrite"><a class="doc-anchor" href="#implementing-asyncread-and-asyncwrite">§</a>Implementing <code>AsyncRead</code> and <code>AsyncWrite</code></h3>
<p>Because they are traits, we can implement <a href="trait.AsyncRead.html" title="trait tokio::io::AsyncRead"><code>AsyncRead</code></a> and <a href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite"><code>AsyncWrite</code></a> for
our own types, as well. Note that these traits must only be implemented for
non-blocking I/O types that integrate with the futures type system. In
other words, these types must never block the thread, and instead the
current task is notified when the I/O resource is ready.</p>
<h3 id="conversion-to-and-from-streamsink"><a class="doc-anchor" href="#conversion-to-and-from-streamsink">§</a>Conversion to and from Stream/Sink</h3>
<p>It is often convenient to encapsulate the reading and writing of bytes in a
<a href="https://docs.rs/futures/0.3/futures/stream/trait.Stream.html"><code>Stream</code></a> or <a href="https://docs.rs/futures/0.3/futures/sink/trait.Sink.html"><code>Sink</code></a> of data.</p>
<p>Tokio provides simple wrappers for converting <a href="trait.AsyncRead.html" title="trait tokio::io::AsyncRead"><code>AsyncRead</code></a> to <a href="https://docs.rs/futures/0.3/futures/stream/trait.Stream.html"><code>Stream</code></a>
and vice-versa in the <a href="https://docs.rs/tokio-util">tokio-util</a> crate, see <a href="https://docs.rs/tokio-util/latest/tokio_util/io/struct.ReaderStream.html"><code>ReaderStream</code></a> and
<a href="https://docs.rs/tokio-util/latest/tokio_util/io/struct.StreamReader.html"><code>StreamReader</code></a>.</p>
<p>There are also utility traits that abstract the asynchronous buffering
necessary to write your own adaptors for encoding and decoding bytes to/from
your structured data, allowing to transform something that implements
<a href="trait.AsyncRead.html" title="trait tokio::io::AsyncRead"><code>AsyncRead</code></a>/<a href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite"><code>AsyncWrite</code></a> into a <a href="https://docs.rs/futures/0.3/futures/stream/trait.Stream.html"><code>Stream</code></a>/<a href="https://docs.rs/futures/0.3/futures/sink/trait.Sink.html"><code>Sink</code></a>, see <a href="https://docs.rs/tokio-util/latest/tokio_util/codec/trait.Decoder.html"><code>Decoder</code></a> and
<a href="https://docs.rs/tokio-util/latest/tokio_util/codec/trait.Encoder.html"><code>Encoder</code></a> in the <a href="https://docs.rs/tokio-util/latest/tokio_util/codec/index.html">tokio-util::codec</a> module.</p>
<h2 id="standard-input-and-output"><a class="doc-anchor" href="#standard-input-and-output">§</a>Standard input and output</h2>
<p>Tokio provides asynchronous APIs to standard <a href="fn.stdin.html" title="fn tokio::io::stdin">input</a>, <a href="fn.stdout.html" title="fn tokio::io::stdout">output</a>, and <a href="fn.stderr.html" title="fn tokio::io::stderr">error</a>.
These APIs are very similar to the ones provided by <code>std</code>, but they also
implement <a href="trait.AsyncRead.html" title="trait tokio::io::AsyncRead"><code>AsyncRead</code></a> and <a href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite"><code>AsyncWrite</code></a>.</p>
<p>Note that the standard input / output APIs <strong>must</strong> be used from the
context of the Tokio runtime, as they require Tokio-specific features to
function. Calling these functions outside of a Tokio runtime will panic.</p>
<h2 id="std-re-exports"><a class="doc-anchor" href="#std-re-exports">§</a><code>std</code> re-exports</h2>
<p>Additionally, <a href="https://doc.rust-lang.org/1.93.1/std/io/error/struct.Error.html" title="struct std::io::error::Error"><code>Error</code></a>, <a href="https://doc.rust-lang.org/1.93.1/std/io/error/enum.ErrorKind.html" title="enum std::io::error::ErrorKind"><code>ErrorKind</code></a>, <a href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result"><code>Result</code></a>, and <a href="https://doc.rust-lang.org/1.93.1/std/io/enum.SeekFrom.html" title="enum std::io::SeekFrom"><code>SeekFrom</code></a> are
re-exported from <code>std::io</code> for ease of use.</p>
</div></details><h2 id="reexports" class="section-header">Re-exports<a href="#reexports" class="anchor">§</a></h2><dl class="item-table reexports"><dt id="reexport.Error"><code>pub use std::io::<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>;</code></dt><dt id="reexport.ErrorKind"><code>pub use std::io::<a class="enum" href="https://doc.rust-lang.org/1.93.1/std/io/error/enum.ErrorKind.html" title="enum std::io::error::ErrorKind">ErrorKind</a>;</code></dt><dt id="reexport.Result"><code>pub use std::io::<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>;</code></dt><dt id="reexport.SeekFrom"><code>pub use std::io::<a class="enum" href="https://doc.rust-lang.org/1.93.1/std/io/enum.SeekFrom.html" title="enum std::io::SeekFrom">SeekFrom</a>;</code></dt></dl><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="unix/index.html" title="mod tokio::io::unix">unix</a></dt><dd>Asynchronous IO structures specific to Unix-like operating systems.</dd></dl><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.BufReader.html" title="struct tokio::io::BufReader">BufReader</a></dt><dd>The <code>BufReader</code> struct adds buffering to any reader.</dd><dt><a class="struct" href="struct.BufStream.html" title="struct tokio::io::BufStream">BufStream</a></dt><dd>Wraps a type that is <a href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite"><code>AsyncWrite</code></a> and <a href="trait.AsyncRead.html" title="trait tokio::io::AsyncRead"><code>AsyncRead</code></a>, and buffers its input and output.</dd><dt><a class="struct" href="struct.BufWriter.html" title="struct tokio::io::BufWriter">BufWriter</a></dt><dd>Wraps a writer and buffers its output.</dd><dt><a class="struct" href="struct.Chain.html" title="struct tokio::io::Chain">Chain</a></dt><dd>Stream for the <a href="trait.AsyncReadExt.html#method.chain" title="method tokio::io::AsyncReadExt::chain"><code>chain</code></a> method.</dd><dt><a class="struct" href="struct.DuplexStream.html" title="struct tokio::io::DuplexStream">Duplex<wbr>Stream</a></dt><dd>A bidirectional pipe to read and write bytes in memory.</dd><dt><a class="struct" href="struct.Empty.html" title="struct tokio::io::Empty">Empty</a></dt><dd><code>Empty</code> ignores any data written via <a href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite"><code>AsyncWrite</code></a>, and will always be empty
(returning zero bytes) when read via <a href="trait.AsyncRead.html" title="trait tokio::io::AsyncRead"><code>AsyncRead</code></a>.</dd><dt><a class="struct" href="struct.Interest.html" title="struct tokio::io::Interest">Interest</a></dt><dd>Readiness event interest.</dd><dt><a class="struct" href="struct.Join.html" title="struct tokio::io::Join">Join</a></dt><dd>Joins two values implementing <code>AsyncRead</code> and <code>AsyncWrite</code> into a
single handle.</dd><dt><a class="struct" href="struct.Lines.html" title="struct tokio::io::Lines">Lines</a></dt><dd>Reads lines from an <a href="trait.AsyncBufRead.html" title="trait tokio::io::AsyncBufRead"><code>AsyncBufRead</code></a>.</dd><dt><a class="struct" href="struct.ReadBuf.html" title="struct tokio::io::ReadBuf">ReadBuf</a></dt><dd>A wrapper around a byte buffer that is incrementally filled and initialized.</dd><dt><a class="struct" href="struct.ReadHalf.html" title="struct tokio::io::ReadHalf">Read<wbr>Half</a></dt><dd>The readable half of a value returned from <a href="fn.split.html" title="fn tokio::io::split"><code>split</code></a>.</dd><dt><a class="struct" href="struct.Ready.html" title="struct tokio::io::Ready">Ready</a></dt><dd>Describes the readiness state of an I/O resources.</dd><dt><a class="struct" href="struct.Repeat.html" title="struct tokio::io::Repeat">Repeat</a></dt><dd>An async reader which yields one byte over and over and over and over and
over and…</dd><dt><a class="struct" href="struct.SimplexStream.html" title="struct tokio::io::SimplexStream">Simplex<wbr>Stream</a></dt><dd>A unidirectional pipe to read and write bytes in memory.</dd><dt><a class="struct" href="struct.Sink.html" title="struct tokio::io::Sink">Sink</a></dt><dd>An async writer which will move data into the void.</dd><dt><a class="struct" href="struct.Split.html" title="struct tokio::io::Split">Split</a></dt><dd>Splitter for the <a href="trait.AsyncBufReadExt.html#method.split" title="method tokio::io::AsyncBufReadExt::split"><code>split</code></a> method.</dd><dt><a class="struct" href="struct.Stderr.html" title="struct tokio::io::Stderr">Stderr</a></dt><dd>A handle to the standard error stream of a process.</dd><dt><a class="struct" href="struct.Stdin.html" title="struct tokio::io::Stdin">Stdin</a></dt><dd>A handle to the standard input stream of a process.</dd><dt><a class="struct" href="struct.Stdout.html" title="struct tokio::io::Stdout">Stdout</a></dt><dd>A handle to the standard output stream of a process.</dd><dt><a class="struct" href="struct.Take.html" title="struct tokio::io::Take">Take</a></dt><dd>Stream for the <a href="trait.AsyncReadExt.html#method.take" title="method tokio::io::AsyncReadExt::take"><code>take</code></a> method.</dd><dt><a class="struct" href="struct.WriteHalf.html" title="struct tokio::io::WriteHalf">Write<wbr>Half</a></dt><dd>The writable half of a value returned from <a href="fn.split.html" title="fn tokio::io::split"><code>split</code></a>.</dd></dl><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><dl class="item-table"><dt><a class="trait" href="trait.AsyncBufRead.html" title="trait tokio::io::AsyncBufRead">Async<wbr>BufRead</a></dt><dd>Reads bytes asynchronously.</dd><dt><a class="trait" href="trait.AsyncBufReadExt.html" title="trait tokio::io::AsyncBufReadExt">Async<wbr>BufRead<wbr>Ext</a></dt><dd>An extension trait which adds utility methods to <a href="trait.AsyncBufRead.html" title="trait tokio::io::AsyncBufRead"><code>AsyncBufRead</code></a> types.</dd><dt><a class="trait" href="trait.AsyncRead.html" title="trait tokio::io::AsyncRead">Async<wbr>Read</a></dt><dd>Reads bytes from a source.</dd><dt><a class="trait" href="trait.AsyncReadExt.html" title="trait tokio::io::AsyncReadExt">Async<wbr>Read<wbr>Ext</a></dt><dd>Reads bytes from a source.</dd><dt><a class="trait" href="trait.AsyncSeek.html" title="trait tokio::io::AsyncSeek">Async<wbr>Seek</a></dt><dd>Seek bytes asynchronously.</dd><dt><a class="trait" href="trait.AsyncSeekExt.html" title="trait tokio::io::AsyncSeekExt">Async<wbr>Seek<wbr>Ext</a></dt><dd>An extension trait that adds utility methods to <a href="trait.AsyncSeek.html" title="trait tokio::io::AsyncSeek"><code>AsyncSeek</code></a> types.</dd><dt><a class="trait" href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite">Async<wbr>Write</a></dt><dd>Writes bytes asynchronously.</dd><dt><a class="trait" href="trait.AsyncWriteExt.html" title="trait tokio::io::AsyncWriteExt">Async<wbr>Write<wbr>Ext</a></dt><dd>Writes bytes to a sink.</dd></dl><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><dl class="item-table"><dt><a class="fn" href="fn.copy.html" title="fn tokio::io::copy">copy</a></dt><dd>Asynchronously copies the entire contents of a reader into a writer.</dd><dt><a class="fn" href="fn.copy_bidirectional.html" title="fn tokio::io::copy_bidirectional">copy_<wbr>bidirectional</a></dt><dd>Copies data in both directions between <code>a</code> and <code>b</code>.</dd><dt><a class="fn" href="fn.copy_bidirectional_with_sizes.html" title="fn tokio::io::copy_bidirectional_with_sizes">copy_<wbr>bidirectional_<wbr>with_<wbr>sizes</a></dt><dd>Copies data in both directions between <code>a</code> and <code>b</code> using buffers of the specified size.</dd><dt><a class="fn" href="fn.copy_buf.html" title="fn tokio::io::copy_buf">copy_<wbr>buf</a></dt><dd>Asynchronously copies the entire contents of a reader into a writer.</dd><dt><a class="fn" href="fn.duplex.html" title="fn tokio::io::duplex">duplex</a></dt><dd>Create a new pair of <code>DuplexStream</code>s that act like a pair of connected sockets.</dd><dt><a class="fn" href="fn.empty.html" title="fn tokio::io::empty">empty</a></dt><dd>Creates a value that is always at EOF for reads, and ignores all data written.</dd><dt><a class="fn" href="fn.join.html" title="fn tokio::io::join">join</a></dt><dd>Join two values implementing <code>AsyncRead</code> and <code>AsyncWrite</code> into a
single handle.</dd><dt><a class="fn" href="fn.repeat.html" title="fn tokio::io::repeat">repeat</a></dt><dd>Creates an instance of an async reader that infinitely repeats one byte.</dd><dt><a class="fn" href="fn.simplex.html" title="fn tokio::io::simplex">simplex</a></dt><dd>Creates unidirectional buffer that acts like in memory pipe.</dd><dt><a class="fn" href="fn.sink.html" title="fn tokio::io::sink">sink</a></dt><dd>Creates an instance of an async writer which will successfully consume all
data.</dd><dt><a class="fn" href="fn.split.html" title="fn tokio::io::split">split</a></dt><dd>Splits a single value implementing <code>AsyncRead + AsyncWrite</code> into separate
<code>AsyncRead</code> and <code>AsyncWrite</code> handles.</dd><dt><a class="fn" href="fn.stderr.html" title="fn tokio::io::stderr">stderr</a></dt><dd>Constructs a new handle to the standard error of the current process.</dd><dt><a class="fn" href="fn.stdin.html" title="fn tokio::io::stdin">stdin</a></dt><dd>Constructs a new handle to the standard input of the current process.</dd><dt><a class="fn" href="fn.stdout.html" title="fn tokio::io::stdout">stdout</a></dt><dd>Constructs a new handle to the standard output of the current process.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tokio/io/struct.Interest.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tokio/io/struct.Interest.html">../../../tokio/io/struct.Interest.html</a>...</p>
<script>location.replace("../../../tokio/io/struct.Interest.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tokio/io/fn.join.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tokio/io/fn.join.html">../../../tokio/io/fn.join.html</a>...</p>
<script>location.replace("../../../tokio/io/fn.join.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tokio/io/struct.Join.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tokio/io/struct.Join.html">../../../tokio/io/struct.Join.html</a>...</p>
<script>location.replace("../../../tokio/io/struct.Join.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tokio/io/struct.ReadBuf.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tokio/io/struct.ReadBuf.html">../../../tokio/io/struct.ReadBuf.html</a>...</p>
<script>location.replace("../../../tokio/io/struct.ReadBuf.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tokio/io/struct.Ready.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tokio/io/struct.Ready.html">../../../tokio/io/struct.Ready.html</a>...</p>
<script>location.replace("../../../tokio/io/struct.Ready.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"fn":["copy","copy_bidirectional","copy_bidirectional_with_sizes","copy_buf","duplex","empty","join","repeat","simplex","sink","split","stderr","stdin","stdout"],"mod":["unix"],"struct":["BufReader","BufStream","BufWriter","Chain","DuplexStream","Empty","Interest","Join","Lines","ReadBuf","ReadHalf","Ready","Repeat","SimplexStream","Sink","Split","Stderr","Stdin","Stdout","Take","WriteHalf"],"trait":["AsyncBufRead","AsyncBufReadExt","AsyncRead","AsyncReadExt","AsyncSeek","AsyncSeekExt","AsyncWrite","AsyncWriteExt"]};

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tokio/io/fn.split.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tokio/io/fn.split.html">../../../tokio/io/fn.split.html</a>...</p>
<script>location.replace("../../../tokio/io/fn.split.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tokio/io/struct.ReadHalf.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tokio/io/struct.ReadHalf.html">../../../tokio/io/struct.ReadHalf.html</a>...</p>
<script>location.replace("../../../tokio/io/struct.ReadHalf.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tokio/io/struct.WriteHalf.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tokio/io/struct.WriteHalf.html">../../../tokio/io/struct.WriteHalf.html</a>...</p>
<script>location.replace("../../../tokio/io/struct.WriteHalf.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tokio/io/fn.stderr.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tokio/io/fn.stderr.html">../../../tokio/io/fn.stderr.html</a>...</p>
<script>location.replace("../../../tokio/io/fn.stderr.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tokio/io/struct.Stderr.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tokio/io/struct.Stderr.html">../../../tokio/io/struct.Stderr.html</a>...</p>
<script>location.replace("../../../tokio/io/struct.Stderr.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tokio/io/fn.stdin.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tokio/io/fn.stdin.html">../../../tokio/io/fn.stdin.html</a>...</p>
<script>location.replace("../../../tokio/io/fn.stdin.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tokio/io/struct.Stdin.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tokio/io/struct.Stdin.html">../../../tokio/io/struct.Stdin.html</a>...</p>
<script>location.replace("../../../tokio/io/struct.Stdin.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tokio/io/fn.stdout.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tokio/io/fn.stdout.html">../../../tokio/io/fn.stdout.html</a>...</p>
<script>location.replace("../../../tokio/io/fn.stdout.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tokio/io/struct.Stdout.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tokio/io/struct.Stdout.html">../../../tokio/io/struct.Stdout.html</a>...</p>
<script>location.replace("../../../tokio/io/struct.Stdout.html" + location.search + location.hash);</script>
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,94 @@
<!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="An async writer which will move data into the void."><title>Sink in tokio::io - 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="#">Sink</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="#">Sink</a></h2><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-AsyncWrite-for-Sink" title="AsyncWrite">AsyncWrite</a></li><li><a href="#impl-Debug-for-Sink" title="Debug">Debug</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-Freeze-for-Sink" title="Freeze">Freeze</a></li><li><a href="#impl-RefUnwindSafe-for-Sink" title="RefUnwindSafe">RefUnwindSafe</a></li><li><a href="#impl-Send-for-Sink" title="Send">Send</a></li><li><a href="#impl-Sync-for-Sink" title="Sync">Sync</a></li><li><a href="#impl-Unpin-for-Sink" title="Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe-for-Sink" 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-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>io</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">io</a></div><h1>Struct <span class="struct">Sink</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/io/util/sink.rs.html#19-21">Source</a> </span></div><pre class="rust item-decl"><code>pub struct Sink { <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>An async writer which will move data into the void.</p>
<p>This struct is generally created by calling <a href="fn.sink.html" title="fn tokio::io::sink"><code>sink</code></a>. Please
see the documentation of <code>sink()</code> for more details.</p>
<p>This is an asynchronous version of <a href="https://doc.rust-lang.org/1.93.1/std/io/util/struct.Sink.html" title="struct std::io::util::Sink"><code>std::io::Sink</code></a>.</p>
</div></details><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-AsyncWrite-for-Sink" class="impl"><a class="src rightside" href="../../src/tokio/io/util/sink.rs.html#53-78">Source</a><a href="#impl-AsyncWrite-for-Sink" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite">AsyncWrite</a> for <a class="struct" href="struct.Sink.html" title="struct tokio::io::Sink">Sink</a></h3></section></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/io/util/sink.rs.html#55-63">Source</a><a href="#method.poll_write" class="anchor">§</a><h4 class="code-header">fn <a href="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="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</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>&gt;&gt;</h4></section></summary><div class='docblock'>Attempt to write bytes from <code>buf</code> into the object. <a href="trait.AsyncWrite.html#tymethod.poll_write">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/io/util/sink.rs.html#66-70">Source</a><a href="#method.poll_flush" class="anchor">§</a><h4 class="code-header">fn <a href="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;,
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="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</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>&gt;&gt;</h4></section></summary><div class='docblock'>Attempts to flush the object, ensuring that any buffered data reach
their destination. <a href="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/io/util/sink.rs.html#73-77">Source</a><a href="#method.poll_shutdown" class="anchor">§</a><h4 class="code-header">fn <a href="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;,
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="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</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>&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="trait.AsyncWrite.html#tymethod.poll_shutdown">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/io/async_write.rs.html#153-163">Source</a><a href="#method.poll_write_vectored" class="anchor">§</a><h4 class="code-header">fn <a href="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="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="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/io/async_write.rs.html#175-177">Source</a><a href="#method.is_write_vectored" class="anchor">§</a><h4 class="code-header">fn <a href="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="trait.AsyncWrite.html#method.poll_write_vectored" title="method tokio::io::AsyncWrite::poll_write_vectored"><code>poll_write_vectored</code></a>
implementation. <a href="trait.AsyncWrite.html#method.is_write_vectored">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Debug-for-Sink" class="impl"><a class="src rightside" href="../../src/tokio/io/util/sink.rs.html#80-84">Source</a><a href="#impl-Debug-for-Sink" 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.Sink.html" title="struct tokio::io::Sink">Sink</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/io/util/sink.rs.html#81-83">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></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-Sink" class="impl"><a href="#impl-Freeze-for-Sink" 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.Sink.html" title="struct tokio::io::Sink">Sink</a></h3></section><section id="impl-RefUnwindSafe-for-Sink" class="impl"><a href="#impl-RefUnwindSafe-for-Sink" 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.Sink.html" title="struct tokio::io::Sink">Sink</a></h3></section><section id="impl-Send-for-Sink" class="impl"><a href="#impl-Send-for-Sink" 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.Sink.html" title="struct tokio::io::Sink">Sink</a></h3></section><section id="impl-Sync-for-Sink" class="impl"><a href="#impl-Sync-for-Sink" 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.Sink.html" title="struct tokio::io::Sink">Sink</a></h3></section><section id="impl-Unpin-for-Sink" class="impl"><a href="#impl-Unpin-for-Sink" 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.Sink.html" title="struct tokio::io::Sink">Sink</a></h3></section><section id="impl-UnwindSafe-for-Sink" class="impl"><a href="#impl-UnwindSafe-for-Sink" 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.Sink.html" title="struct tokio::io::Sink">Sink</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-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="trait.AsyncWriteExt.html" title="trait tokio::io::AsyncWriteExt">AsyncWriteExt</a> for W<div class="where">where
W: <a class="trait" href="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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-1" 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-1" 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" 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" 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" 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" 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>

View File

@@ -0,0 +1,47 @@
<!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="Splitter for the `split` method."><title>Split in tokio::io - 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="#">Split</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="#">Split</a></h2><h3><a href="#implementations">Methods</a></h3><ul class="block method"><li><a href="#method.next_segment" title="next_segment">next_segment</a></li><li><a href="#method.poll_next_segment" title="poll_next_segment">poll_next_segment</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-Debug-for-Split%3CR%3E" title="Debug">Debug</a></li><li><a href="#impl-Unpin-for-Split%3CR%3E" title="Unpin">Unpin</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-Freeze-for-Split%3CR%3E" title="Freeze">Freeze</a></li><li><a href="#impl-RefUnwindSafe-for-Split%3CR%3E" title="RefUnwindSafe">RefUnwindSafe</a></li><li><a href="#impl-Send-for-Split%3CR%3E" title="Send">Send</a></li><li><a href="#impl-Sync-for-Split%3CR%3E" title="Sync">Sync</a></li><li><a href="#impl-UnwindSafe-for-Split%3CR%3E" 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-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>io</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">io</a></div><h1>Struct <span class="struct">Split</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/io/util/split.rs.html#10-26">Source</a> </span></div><pre class="rust item-decl"><code>pub struct Split&lt;R&gt; { <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>Splitter for the <a href="trait.AsyncBufReadExt.html#method.split" title="method tokio::io::AsyncBufReadExt::split"><code>split</code></a> method.</p>
<p>A <code>Split</code> can be turned into a <code>Stream</code> with <a href="https://docs.rs/tokio-stream/0.1/tokio_stream/wrappers/struct.SplitStream.html"><code>SplitStream</code></a>.</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-Split%3CR%3E" class="impl"><a class="src rightside" href="../../src/tokio/io/util/split.rs.html#40-66">Source</a><a href="#impl-Split%3CR%3E" class="anchor">§</a><h3 class="code-header">impl&lt;R&gt; <a class="struct" href="struct.Split.html" title="struct tokio::io::Split">Split</a>&lt;R&gt;<div class="where">where
R: <a class="trait" href="trait.AsyncBufRead.html" title="trait tokio::io::AsyncBufRead">AsyncBufRead</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>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.next_segment" class="method"><a class="src rightside" href="../../src/tokio/io/util/split.rs.html#61-65">Source</a><h4 class="code-header">pub async fn <a href="#method.next_segment" class="fn">next_segment</a>(&amp;mut 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/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;&gt;</h4></section></summary><div class="docblock"><p>Returns the next segment in the stream.</p>
<h5 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::io::AsyncBufReadExt;
<span class="kw">let </span><span class="kw-2">mut </span>segments = my_buf_read.split(<span class="string">b'f'</span>);
<span class="kw">while let </span><span class="prelude-val">Some</span>(segment) = segments.next_segment().<span class="kw">await</span><span class="question-mark">? </span>{
<span class="macro">println!</span>(<span class="string">"length = {}"</span>, segment.len())
}</code></pre></div></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Split%3CR%3E-1" class="impl"><a class="src rightside" href="../../src/tokio/io/util/split.rs.html#68-111">Source</a><a href="#impl-Split%3CR%3E-1" class="anchor">§</a><h3 class="code-header">impl&lt;R&gt; <a class="struct" href="struct.Split.html" title="struct tokio::io::Split">Split</a>&lt;R&gt;<div class="where">where
R: <a class="trait" href="trait.AsyncBufRead.html" title="trait tokio::io::AsyncBufRead">AsyncBufRead</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.poll_next_segment" class="method"><a class="src rightside" href="../../src/tokio/io/util/split.rs.html#89-110">Source</a><h4 class="code-header">pub fn <a href="#method.poll_next_segment" class="fn">poll_next_segment</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;,
) -&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="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/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;&gt;&gt;</h4></section></summary><div class="docblock"><p>Polls for the next segment in the stream.</p>
<p>This method returns:</p>
<ul>
<li><code>Poll::Pending</code> if the next segment is not yet available.</li>
<li><code>Poll::Ready(Ok(Some(segment)))</code> if the next segment is available.</li>
<li><code>Poll::Ready(Ok(None))</code> if there are no more segments in this stream.</li>
<li><code>Poll::Ready(Err(err))</code> if an IO error occurred while reading the
next segment.</li>
</ul>
<p>When the method returns <code>Poll::Pending</code>, the <code>Waker</code> in the provided
<code>Context</code> is scheduled to receive a wakeup when more bytes become
available on the underlying IO resource.</p>
<p>Note that on multiple calls to <code>poll_next_segment</code>, only the <code>Waker</code>
from the <code>Context</code> passed to the most recent call is scheduled to
receive a wakeup.</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-Debug-for-Split%3CR%3E" class="impl"><a class="src rightside" href="../../src/tokio/io/util/split.rs.html#16">Source</a><a href="#impl-Debug-for-Split%3CR%3E" class="anchor">§</a><h3 class="code-header">impl&lt;R: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>&gt; <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.Split.html" title="struct tokio::io::Split">Split</a>&lt;R&gt;</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/io/util/split.rs.html#16">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><section id="impl-Unpin-for-Split%3CR%3E" class="impl"><a class="src rightside" href="../../src/tokio/io/util/split.rs.html#10-26">Source</a><a href="#impl-Unpin-for-Split%3CR%3E" class="anchor">§</a><h3 class="code-header">impl&lt;'__pin, R&gt; <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.Split.html" title="struct tokio::io::Split">Split</a>&lt;R&gt;<div class="where">where
PinnedFieldsOf&lt;__Origin&lt;'__pin, R&gt;&gt;: <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></h3></section></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-Split%3CR%3E" class="impl"><a href="#impl-Freeze-for-Split%3CR%3E" class="anchor">§</a><h3 class="code-header">impl&lt;R&gt; <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.Split.html" title="struct tokio::io::Split">Split</a>&lt;R&gt;<div class="where">where
R: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Freeze.html" title="trait core::marker::Freeze">Freeze</a>,</div></h3></section><section id="impl-RefUnwindSafe-for-Split%3CR%3E" class="impl"><a href="#impl-RefUnwindSafe-for-Split%3CR%3E" class="anchor">§</a><h3 class="code-header">impl&lt;R&gt; <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.Split.html" title="struct tokio::io::Split">Split</a>&lt;R&gt;<div class="where">where
R: <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>,</div></h3></section><section id="impl-Send-for-Split%3CR%3E" class="impl"><a href="#impl-Send-for-Split%3CR%3E" class="anchor">§</a><h3 class="code-header">impl&lt;R&gt; <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.Split.html" title="struct tokio::io::Split">Split</a>&lt;R&gt;<div class="where">where
R: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,</div></h3></section><section id="impl-Sync-for-Split%3CR%3E" class="impl"><a href="#impl-Sync-for-Split%3CR%3E" class="anchor">§</a><h3 class="code-header">impl&lt;R&gt; <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.Split.html" title="struct tokio::io::Split">Split</a>&lt;R&gt;<div class="where">where
R: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,</div></h3></section><section id="impl-UnwindSafe-for-Split%3CR%3E" class="impl"><a href="#impl-UnwindSafe-for-Split%3CR%3E" class="anchor">§</a><h3 class="code-header">impl&lt;R&gt; <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.Split.html" title="struct tokio::io::Split">Split</a>&lt;R&gt;<div class="where">where
R: <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>,</div></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-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-1" 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-1" 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" 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" 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" 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" 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>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,63 @@
<!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="Reads bytes asynchronously."><title>AsyncBufRead in tokio::io - 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 trait"><!--[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="#">AsyncBufRead</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="#">Async<wbr>BufRead</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.consume" title="consume">consume</a></li><li><a href="#tymethod.poll_fill_buf" title="poll_fill_buf">poll_fill_buf</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-AsyncBufRead-for-%26%5Bu8%5D" title="&#38;[u8]">&#38;[u8]</a></li><li><a href="#impl-AsyncBufRead-for-%26mut+T" title="&#38;mut T">&#38;mut T</a></li><li><a href="#impl-AsyncBufRead-for-Box%3CT%3E" title="Box&#60;T&#62;">Box&#60;T&#62;</a></li><li><a href="#impl-AsyncBufRead-for-Cursor%3CT%3E" title="Cursor&#60;T&#62;">Cursor&#60;T&#62;</a></li><li><a href="#impl-AsyncBufRead-for-Pin%3CP%3E" title="Pin&#60;P&#62;">Pin&#60;P&#62;</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>io</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">io</a></div><h1>Trait <span class="trait">Async<wbr>BufRead</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/io/async_buf_read.rs.html#23-63">Source</a> </span></div><pre class="rust item-decl"><code>pub trait AsyncBufRead: <a class="trait" href="trait.AsyncRead.html" title="trait tokio::io::AsyncRead">AsyncRead</a> {
// Required methods
fn <a href="#tymethod.poll_fill_buf" class="fn">poll_fill_buf</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;,
) -&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;&amp;[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>]&gt;&gt;;
<span class="item-spacer"></span> fn <a href="#tymethod.consume" class="fn">consume</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;, amt: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>);
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Reads bytes asynchronously.</p>
<p>This trait is analogous to <a href="https://doc.rust-lang.org/1.93.1/std/io/trait.BufRead.html" title="trait std::io::BufRead"><code>std::io::BufRead</code></a>, but integrates with
the asynchronous task system. In particular, the <a href="trait.AsyncBufRead.html#tymethod.poll_fill_buf" title="method tokio::io::AsyncBufRead::poll_fill_buf"><code>poll_fill_buf</code></a> method,
unlike <a href="https://doc.rust-lang.org/1.93.1/std/io/trait.BufRead.html#tymethod.fill_buf" title="method std::io::BufRead::fill_buf"><code>BufRead::fill_buf</code></a>, will automatically queue the current task for wakeup
and return if data is not yet available, rather than blocking the calling
thread.</p>
<p>Utilities for working with <code>AsyncBufRead</code> values are provided by
<a href="trait.AsyncBufReadExt.html" title="trait tokio::io::AsyncBufReadExt"><code>AsyncBufReadExt</code></a>.</p>
</div></details><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.poll_fill_buf" class="method"><a class="src rightside" href="../../src/tokio/io/async_buf_read.rs.html#45">Source</a><h4 class="code-header">fn <a href="#tymethod.poll_fill_buf" class="fn">poll_fill_buf</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;,
) -&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;&amp;[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>]&gt;&gt;</h4></section></summary><div class="docblock"><p>Attempts to return the contents of the internal buffer, filling it with more data
from the inner reader if it is empty.</p>
<p>On success, returns <code>Poll::Ready(Ok(buf))</code>.</p>
<p>If no data is available for reading, the method returns
<code>Poll::Pending</code> and arranges for the current task (via
<code>cx.waker().wake_by_ref()</code>) to receive a notification when the object becomes
readable or is closed.</p>
<p>This function is a lower-level call. It needs to be paired with the
<a href="trait.AsyncBufRead.html#tymethod.consume" title="method tokio::io::AsyncBufRead::consume"><code>consume</code></a> method to function properly. When calling this
method, none of the contents will be “read” in the sense that later
calling <a href="trait.AsyncRead.html#tymethod.poll_read" title="method tokio::io::AsyncRead::poll_read"><code>poll_read</code></a> may return the same contents. As such, <a href="trait.AsyncBufRead.html#tymethod.consume" title="method tokio::io::AsyncBufRead::consume"><code>consume</code></a> must
be called with the number of bytes that are consumed from this buffer to
ensure that the bytes are never returned twice.</p>
<p>An empty buffer returned indicates that the stream has reached EOF.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.consume" class="method"><a class="src rightside" href="../../src/tokio/io/async_buf_read.rs.html#62">Source</a><h4 class="code-header">fn <a href="#tymethod.consume" class="fn">consume</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;, amt: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>)</h4></section></summary><div class="docblock"><p>Tells this buffer that <code>amt</code> bytes have been consumed from the buffer,
so they should no longer be returned in calls to <a href="trait.AsyncRead.html#tymethod.poll_read" title="method tokio::io::AsyncRead::poll_read"><code>poll_read</code></a>.</p>
<p>This function is a lower-level call. It needs to be paired with the
<a href="trait.AsyncBufRead.html#tymethod.poll_fill_buf" title="method tokio::io::AsyncBufRead::poll_fill_buf"><code>poll_fill_buf</code></a> method to function properly. This function does
not perform any I/O, it simply informs this object that some amount of
its buffer, returned from <a href="trait.AsyncBufRead.html#tymethod.poll_fill_buf" title="method tokio::io::AsyncBufRead::poll_fill_buf"><code>poll_fill_buf</code></a>, has been consumed and should
no longer be returned. As such, this function may do odd things if
<a href="trait.AsyncBufRead.html#tymethod.poll_fill_buf" title="method tokio::io::AsyncBufRead::poll_fill_buf"><code>poll_fill_buf</code></a> isnt called before calling it.</p>
<p>The <code>amt</code> must be <code>&lt;=</code> the number of bytes in the buffer returned by
<a href="trait.AsyncBufRead.html#tymethod.poll_fill_buf" title="method tokio::io::AsyncBufRead::poll_fill_buf"><code>poll_fill_buf</code></a>.</p>
</div></details></div><h2 id="foreign-impls" class="section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor">§</a></h2><details class="toggle implementors-toggle"><summary><section id="impl-AsyncBufRead-for-%26%5Bu8%5D" class="impl"><a class="src rightside" href="../../src/tokio/io/async_buf_read.rs.html#99-107">Source</a><a href="#impl-AsyncBufRead-for-%26%5Bu8%5D" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsyncBufRead.html" title="trait tokio::io::AsyncBufRead">AsyncBufRead</a> for &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>]</h3></section></summary><div class="impl-items"><section id="method.poll_fill_buf" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/async_buf_read.rs.html#100-102">Source</a><a href="#method.poll_fill_buf" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.poll_fill_buf" class="fn">poll_fill_buf</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;,
) -&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;&amp;[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>]&gt;&gt;</h4></section><section id="method.consume" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/async_buf_read.rs.html#104-106">Source</a><a href="#method.consume" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.consume" class="fn">consume</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;, amt: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>)</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-AsyncBufRead-for-Pin%3CP%3E" class="impl"><a class="src rightside" href="../../src/tokio/io/async_buf_read.rs.html#85-97">Source</a><a href="#impl-AsyncBufRead-for-Pin%3CP%3E" class="anchor">§</a><h3 class="code-header">impl&lt;P&gt; <a class="trait" href="trait.AsyncBufRead.html" title="trait tokio::io::AsyncBufRead">AsyncBufRead</a> for <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;P&gt;<div class="where">where
P: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/deref/trait.DerefMut.html" title="trait core::ops::deref::DerefMut">DerefMut</a>,
P::<a class="associatedtype" href="https://doc.rust-lang.org/1.93.1/core/ops/deref/trait.Deref.html#associatedtype.Target" title="type core::ops::deref::Deref::Target">Target</a>: <a class="trait" href="trait.AsyncBufRead.html" title="trait tokio::io::AsyncBufRead">AsyncBufRead</a>,</div></h3></section></summary><div class="impl-items"><section id="method.poll_fill_buf-1" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/async_buf_read.rs.html#90-92">Source</a><a href="#method.poll_fill_buf-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.poll_fill_buf" class="fn">poll_fill_buf</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;,
) -&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;&amp;[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>]&gt;&gt;</h4></section><section id="method.consume-1" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/async_buf_read.rs.html#94-96">Source</a><a href="#method.consume-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.consume" class="fn">consume</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;, amt: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>)</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-AsyncBufRead-for-Cursor%3CT%3E" class="impl"><a class="src rightside" href="../../src/tokio/io/async_buf_read.rs.html#109-117">Source</a><a href="#impl-AsyncBufRead-for-Cursor%3CT%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T: <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="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>]&gt; + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>&gt; <a class="trait" href="trait.AsyncBufRead.html" title="trait tokio::io::AsyncBufRead">AsyncBufRead</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/std/io/cursor/struct.Cursor.html" title="struct std::io::cursor::Cursor">Cursor</a>&lt;T&gt;</h3></section></summary><div class="impl-items"><section id="method.poll_fill_buf-2" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/async_buf_read.rs.html#110-112">Source</a><a href="#method.poll_fill_buf-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.poll_fill_buf" class="fn">poll_fill_buf</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;,
) -&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;&amp;[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>]&gt;&gt;</h4></section><section id="method.consume-2" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/async_buf_read.rs.html#114-116">Source</a><a href="#method.consume-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.consume" class="fn">consume</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;, amt: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>)</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-AsyncBufRead-for-%26mut+T" class="impl"><a class="src rightside" href="../../src/tokio/io/async_buf_read.rs.html#81-83">Source</a><a href="#impl-AsyncBufRead-for-%26mut+T" class="anchor">§</a><h3 class="code-header">impl&lt;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> + <a class="trait" href="trait.AsyncBufRead.html" title="trait tokio::io::AsyncBufRead">AsyncBufRead</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>&gt; <a class="trait" href="trait.AsyncBufRead.html" title="trait tokio::io::AsyncBufRead">AsyncBufRead</a> for <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;mut T</a></h3></section></summary><div class="impl-items"><section id="method.poll_fill_buf-3" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/async_buf_read.rs.html#82">Source</a><a href="#method.poll_fill_buf-3" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.poll_fill_buf" class="fn">poll_fill_buf</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;,
) -&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;&amp;[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>]&gt;&gt;</h4></section><section id="method.consume-3" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/async_buf_read.rs.html#82">Source</a><a href="#method.consume-3" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.consume" class="fn">consume</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;, amt: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>)</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-AsyncBufRead-for-Box%3CT%3E" class="impl"><a class="src rightside" href="../../src/tokio/io/async_buf_read.rs.html#77-79">Source</a><a href="#impl-AsyncBufRead-for-Box%3CT%3E" class="anchor">§</a><h3 class="code-header">impl&lt;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> + <a class="trait" href="trait.AsyncBufRead.html" title="trait tokio::io::AsyncBufRead">AsyncBufRead</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>&gt; <a class="trait" href="trait.AsyncBufRead.html" title="trait tokio::io::AsyncBufRead">AsyncBufRead</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;T&gt;</h3></section></summary><div class="impl-items"><section id="method.poll_fill_buf-4" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/async_buf_read.rs.html#78">Source</a><a href="#method.poll_fill_buf-4" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.poll_fill_buf" class="fn">poll_fill_buf</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;,
) -&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;&amp;[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>]&gt;&gt;</h4></section><section id="method.consume-4" class="method trait-impl"><a class="src rightside" href="../../src/tokio/io/async_buf_read.rs.html#78">Source</a><a href="#method.consume-4" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.consume" class="fn">consume</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;, amt: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>)</h4></section></div></details><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-AsyncBufRead-for-Empty" class="impl"><a class="src rightside" href="../../src/tokio/io/util/empty.rs.html#80-90">Source</a><a href="#impl-AsyncBufRead-for-Empty" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsyncBufRead.html" title="trait tokio::io::AsyncBufRead">AsyncBufRead</a> for <a class="struct" href="struct.Empty.html" title="struct tokio::io::Empty">Empty</a></h3></section><section id="impl-AsyncBufRead-for-Join%3CR,+W%3E" class="impl"><a class="src rightside" href="../../src/tokio/io/join.rs.html#119-130">Source</a><a href="#impl-AsyncBufRead-for-Join%3CR,+W%3E" class="anchor">§</a><h3 class="code-header">impl&lt;R, W&gt; <a class="trait" href="trait.AsyncBufRead.html" title="trait tokio::io::AsyncBufRead">AsyncBufRead</a> for <a class="struct" href="struct.Join.html" title="struct tokio::io::Join">Join</a>&lt;R, W&gt;<div class="where">where
R: <a class="trait" href="trait.AsyncBufRead.html" title="trait tokio::io::AsyncBufRead">AsyncBufRead</a>,</div></h3></section><section id="impl-AsyncBufRead-for-Take%3CR%3E" class="impl"><a class="src rightside" href="../../src/tokio/io/util/take.rs.html#107-128">Source</a><a href="#impl-AsyncBufRead-for-Take%3CR%3E" class="anchor">§</a><h3 class="code-header">impl&lt;R: <a class="trait" href="trait.AsyncBufRead.html" title="trait tokio::io::AsyncBufRead">AsyncBufRead</a>&gt; <a class="trait" href="trait.AsyncBufRead.html" title="trait tokio::io::AsyncBufRead">AsyncBufRead</a> for <a class="struct" href="struct.Take.html" title="struct tokio::io::Take">Take</a>&lt;R&gt;</h3></section><section id="impl-AsyncBufRead-for-BufReader%3CR%3E" class="impl"><a class="src rightside" href="../../src/tokio/io/util/buf_reader.rs.html#122-144">Source</a><a href="#impl-AsyncBufRead-for-BufReader%3CR%3E" class="anchor">§</a><h3 class="code-header">impl&lt;R: <a class="trait" href="trait.AsyncRead.html" title="trait tokio::io::AsyncRead">AsyncRead</a>&gt; <a class="trait" href="trait.AsyncBufRead.html" title="trait tokio::io::AsyncBufRead">AsyncBufRead</a> for <a class="struct" href="struct.BufReader.html" title="struct tokio::io::BufReader">BufReader</a>&lt;R&gt;</h3></section><section id="impl-AsyncBufRead-for-BufStream%3CRW%3E" class="impl"><a class="src rightside" href="../../src/tokio/io/util/buf_stream.rs.html#189-197">Source</a><a href="#impl-AsyncBufRead-for-BufStream%3CRW%3E" class="anchor">§</a><h3 class="code-header">impl&lt;RW: <a class="trait" href="trait.AsyncRead.html" title="trait tokio::io::AsyncRead">AsyncRead</a> + <a class="trait" href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite">AsyncWrite</a>&gt; <a class="trait" href="trait.AsyncBufRead.html" title="trait tokio::io::AsyncBufRead">AsyncBufRead</a> for <a class="struct" href="struct.BufStream.html" title="struct tokio::io::BufStream">BufStream</a>&lt;RW&gt;</h3></section><section id="impl-AsyncBufRead-for-Chain%3CT,+U%3E" class="impl"><a class="src rightside" href="../../src/tokio/io/util/chain.rs.html#107-134">Source</a><a href="#impl-AsyncBufRead-for-Chain%3CT,+U%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="trait.AsyncBufRead.html" title="trait tokio::io::AsyncBufRead">AsyncBufRead</a> for <a class="struct" href="struct.Chain.html" title="struct tokio::io::Chain">Chain</a>&lt;T, U&gt;<div class="where">where
T: <a class="trait" href="trait.AsyncBufRead.html" title="trait tokio::io::AsyncBufRead">AsyncBufRead</a>,
U: <a class="trait" href="trait.AsyncBufRead.html" title="trait tokio::io::AsyncBufRead">AsyncBufRead</a>,</div></h3></section><section id="impl-AsyncBufRead-for-BufWriter%3CW%3E" class="impl"><a class="src rightside" href="../../src/tokio/io/util/buf_writer.rs.html#279-287">Source</a><a href="#impl-AsyncBufRead-for-BufWriter%3CW%3E" class="anchor">§</a><h3 class="code-header">impl&lt;W: <a class="trait" href="trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite">AsyncWrite</a> + <a class="trait" href="trait.AsyncBufRead.html" title="trait tokio::io::AsyncBufRead">AsyncBufRead</a>&gt; <a class="trait" href="trait.AsyncBufRead.html" title="trait tokio::io::AsyncBufRead">AsyncBufRead</a> for <a class="struct" href="struct.BufWriter.html" title="struct tokio::io::BufWriter">BufWriter</a>&lt;W&gt;</h3></section></div><script src="../../trait.impl/tokio/io/async_buf_read/trait.AsyncBufRead.js" data-ignore-extern-crates="alloc,core,std" async></script></section></div></main></body></html>

View File

@@ -0,0 +1,225 @@
<!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="An extension trait which adds utility methods to `AsyncBufRead` types."><title>AsyncBufReadExt in tokio::io - 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 trait"><!--[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="#">AsyncBufReadExt</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="#">Async<wbr>BufRead<wbr>Ext</a></h2><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.consume" title="consume">consume</a></li><li><a href="#method.fill_buf" title="fill_buf">fill_buf</a></li><li><a href="#method.lines" title="lines">lines</a></li><li><a href="#method.read_line" title="read_line">read_line</a></li><li><a href="#method.read_until" title="read_until">read_until</a></li><li><a href="#method.split" title="split">split</a></li></ul><h3><a href="#dyn-compatibility">Dyn Compatibility</a></h3><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>io</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">io</a></div><h1>Trait <span class="trait">Async<wbr>BufRead<wbr>Ext</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/io/util/async_buf_read_ext.rs.html#12-354">Source</a> </span></div><pre class="rust item-decl"><code>pub trait AsyncBufReadExt: <a class="trait" href="trait.AsyncBufRead.html" title="trait tokio::io::AsyncBufRead">AsyncBufRead</a> {
// Provided methods
fn <a href="#method.read_until" class="fn">read_until</a>&lt;'a&gt;(
&amp;'a mut self,
byte: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>,
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; ReadUntil&lt;'a, Self&gt;
<span 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></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.read_line" class="fn">read_line</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/string/struct.String.html" title="struct alloc::string::String">String</a>) -&gt; ReadLine&lt;'a, Self&gt;
<span 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></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.split" class="fn">split</a>(self, byte: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>) -&gt; <a class="struct" href="struct.Split.html" title="struct tokio::io::Split">Split</a>&lt;Self&gt;
<span 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></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.fill_buf" class="fn">fill_buf</a>(&amp;mut self) -&gt; FillBuf&lt;'_, Self&gt;
<span 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></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.consume" class="fn">consume</a>(&amp;mut self, amt: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>)
<span 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></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.lines" class="fn">lines</a>(self) -&gt; <a class="struct" href="struct.Lines.html" title="struct tokio::io::Lines">Lines</a>&lt;Self&gt;
<span 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></span> { ... }
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>An extension trait which adds utility methods to <a href="trait.AsyncBufRead.html" title="trait tokio::io::AsyncBufRead"><code>AsyncBufRead</code></a> types.</p>
</div></details><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.read_until" class="method"><a class="src rightside" href="../../src/tokio/io/util/async_buf_read_ext.rs.html#96-101">Source</a><h4 class="code-header">fn <a href="#method.read_until" class="fn">read_until</a>&lt;'a&gt;(
&amp;'a mut self,
byte: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>,
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; ReadUntil&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"><p>Reads all bytes into <code>buf</code> until the delimiter <code>byte</code> or EOF is reached.</p>
<p>Equivalent to:</p>
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested"></a><pre class="rust rust-example-rendered"><code><span class="kw">async fn </span>read_until(<span class="kw-2">&amp;mut </span><span class="self">self</span>, byte: u8, buf: <span class="kw-2">&amp;mut </span>Vec&lt;u8&gt;) -&gt; io::Result&lt;usize&gt;;</code></pre></div>
<p>This function will read bytes from the underlying stream until the
delimiter or EOF is found. Once found, all bytes up to, and including,
the delimiter (if found) will be appended to <code>buf</code>.</p>
<p>If successful, this function will return the total number of bytes read.</p>
<p>If this function returns <code>Ok(0)</code>, the stream has reached EOF.</p>
<h5 id="errors"><a class="doc-anchor" href="#errors">§</a>Errors</h5>
<p>This function will ignore all instances of <a href="https://doc.rust-lang.org/1.93.1/std/io/error/enum.ErrorKind.html#variant.Interrupted" title="variant std::io::error::ErrorKind::Interrupted"><code>ErrorKind::Interrupted</code></a> and
will otherwise return any errors returned by <a href="trait.AsyncBufRead.html#tymethod.poll_fill_buf" title="method tokio::io::AsyncBufRead::poll_fill_buf"><code>fill_buf</code></a>.</p>
<p>If an I/O error is encountered then all bytes read so far will be
present in <code>buf</code> and its length will have been adjusted appropriately.</p>
<h5 id="cancel-safety"><a class="doc-anchor" href="#cancel-safety">§</a>Cancel safety</h5>
<p>If the method is used as the event in a
<a href="../macro.select.html" title="macro tokio::select"><code>tokio::select!</code></a> statement and some other branch
completes first, then some data may have been partially read. Any
partially read bytes are appended to <code>buf</code>, and the method can be
called again to continue reading until <code>byte</code>.</p>
<p>This method returns the total number of bytes read. If you cancel
the call to <code>read_until</code> and then call it again to continue reading,
the counter is reset.</p>
<h5 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h5>
<p><a href="https://doc.rust-lang.org/1.93.1/std/io/cursor/struct.Cursor.html" title="struct std::io::cursor::Cursor"><code>std::io::Cursor</code></a> is a type that implements <code>BufRead</code>. In
this example, we use <a href="https://doc.rust-lang.org/1.93.1/std/io/cursor/struct.Cursor.html" title="struct std::io::cursor::Cursor"><code>Cursor</code></a> to read all the bytes in a byte slice
in hyphen delimited segments:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::io::AsyncBufReadExt;
<span class="kw">use </span>std::io::Cursor;
<span class="kw">let </span><span class="kw-2">mut </span>cursor = Cursor::new(<span class="string">b"lorem-ipsum"</span>);
<span class="kw">let </span><span class="kw-2">mut </span>buf = <span class="macro">vec!</span>[];
<span class="comment">// cursor is at 'l'
</span><span class="kw">let </span>num_bytes = cursor.read_until(<span class="string">b'-'</span>, <span class="kw-2">&amp;mut </span>buf)
.<span class="kw">await
</span>.expect(<span class="string">"reading from cursor won't fail"</span>);
<span class="macro">assert_eq!</span>(num_bytes, <span class="number">6</span>);
<span class="macro">assert_eq!</span>(buf, <span class="string">b"lorem-"</span>);
buf.clear();
<span class="comment">// cursor is at 'i'
</span><span class="kw">let </span>num_bytes = cursor.read_until(<span class="string">b'-'</span>, <span class="kw-2">&amp;mut </span>buf)
.<span class="kw">await
</span>.expect(<span class="string">"reading from cursor won't fail"</span>);
<span class="macro">assert_eq!</span>(num_bytes, <span class="number">5</span>);
<span class="macro">assert_eq!</span>(buf, <span class="string">b"ipsum"</span>);
buf.clear();
<span class="comment">// cursor is at EOF
</span><span class="kw">let </span>num_bytes = cursor.read_until(<span class="string">b'-'</span>, <span class="kw-2">&amp;mut </span>buf)
.<span class="kw">await
</span>.expect(<span class="string">"reading from cursor won't fail"</span>);
<span class="macro">assert_eq!</span>(num_bytes, <span class="number">0</span>);
<span class="macro">assert_eq!</span>(buf, <span class="string">b""</span>);</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.read_line" class="method"><a class="src rightside" href="../../src/tokio/io/util/async_buf_read_ext.rs.html#199-204">Source</a><h4 class="code-header">fn <a href="#method.read_line" class="fn">read_line</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/string/struct.String.html" title="struct alloc::string::String">String</a>) -&gt; ReadLine&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"><p>Reads all bytes until a newline (the 0xA byte) is reached, and append
them to the provided buffer.</p>
<p>Equivalent to:</p>
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested"></a><pre class="rust rust-example-rendered"><code><span class="kw">async fn </span>read_line(<span class="kw-2">&amp;mut </span><span class="self">self</span>, buf: <span class="kw-2">&amp;mut </span>String) -&gt; io::Result&lt;usize&gt;;</code></pre></div>
<p>This function will read bytes from the underlying stream until the
newline delimiter (the 0xA byte) or EOF is found. Once found, all bytes
up to, and including, the delimiter (if found) will be appended to
<code>buf</code>.</p>
<p>If successful, this function will return the total number of bytes read.</p>
<p>If this function returns <code>Ok(0)</code>, the stream has reached EOF.</p>
<h5 id="errors-1"><a class="doc-anchor" href="#errors-1">§</a>Errors</h5>
<p>This function has the same error semantics as <a href="trait.AsyncBufReadExt.html#method.read_until" title="method tokio::io::AsyncBufReadExt::read_until"><code>read_until</code></a> and will
also return an error if the read bytes are not valid UTF-8. If an I/O
error is encountered then <code>buf</code> may contain some bytes already read in
the event that all data read so far was valid UTF-8.</p>
<h5 id="cancel-safety-1"><a class="doc-anchor" href="#cancel-safety-1">§</a>Cancel safety</h5>
<p>This method is not cancellation safe. If the method is used as the
event in a <a href="../macro.select.html" title="macro tokio::select"><code>tokio::select!</code></a> statement and some
other branch completes first, then some data may have been partially
read, and this data is lost. There are no guarantees regarding the
contents of <code>buf</code> when the call is cancelled. The current
implementation replaces <code>buf</code> with the empty string, but this may
change in the future.</p>
<p>This function does not behave like <a href="trait.AsyncBufReadExt.html#method.read_until" title="method tokio::io::AsyncBufReadExt::read_until"><code>read_until</code></a> because of the
requirement that a string contains only valid utf-8. If you need a
cancellation safe <code>read_line</code>, there are three options:</p>
<ul>
<li>Call <a href="trait.AsyncBufReadExt.html#method.read_until" title="method tokio::io::AsyncBufReadExt::read_until"><code>read_until</code></a> with a newline character and manually perform the utf-8 check.</li>
<li>The stream returned by <a href="trait.AsyncBufReadExt.html#method.lines"><code>lines</code></a> has a cancellation safe
<a href="struct.Lines.html#method.next_line" title="method tokio::io::Lines::next_line"><code>next_line</code></a> method.</li>
<li>Use <a href="https://docs.rs/tokio-util/latest/tokio_util/codec/struct.LinesCodec.html"><code>tokio_util::codec::LinesCodec</code></a>.</li>
</ul>
<h5 id="examples-1"><a class="doc-anchor" href="#examples-1">§</a>Examples</h5>
<p><a href="https://doc.rust-lang.org/1.93.1/std/io/cursor/struct.Cursor.html" title="struct std::io::cursor::Cursor"><code>std::io::Cursor</code></a> is a type that implements
<code>AsyncBufRead</code>. In this example, we use <a href="https://doc.rust-lang.org/1.93.1/std/io/cursor/struct.Cursor.html" title="struct std::io::cursor::Cursor"><code>Cursor</code></a> to read all the
lines in a byte slice:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::io::AsyncBufReadExt;
<span class="kw">use </span>std::io::Cursor;
<span class="kw">let </span><span class="kw-2">mut </span>cursor = Cursor::new(<span class="string">b"foo\nbar"</span>);
<span class="kw">let </span><span class="kw-2">mut </span>buf = String::new();
<span class="comment">// cursor is at 'f'
</span><span class="kw">let </span>num_bytes = cursor.read_line(<span class="kw-2">&amp;mut </span>buf)
.<span class="kw">await
</span>.expect(<span class="string">"reading from cursor won't fail"</span>);
<span class="macro">assert_eq!</span>(num_bytes, <span class="number">4</span>);
<span class="macro">assert_eq!</span>(buf, <span class="string">"foo\n"</span>);
buf.clear();
<span class="comment">// cursor is at 'b'
</span><span class="kw">let </span>num_bytes = cursor.read_line(<span class="kw-2">&amp;mut </span>buf)
.<span class="kw">await
</span>.expect(<span class="string">"reading from cursor won't fail"</span>);
<span class="macro">assert_eq!</span>(num_bytes, <span class="number">3</span>);
<span class="macro">assert_eq!</span>(buf, <span class="string">"bar"</span>);
buf.clear();
<span class="comment">// cursor is at EOF
</span><span class="kw">let </span>num_bytes = cursor.read_line(<span class="kw-2">&amp;mut </span>buf)
.<span class="kw">await
</span>.expect(<span class="string">"reading from cursor won't fail"</span>);
<span class="macro">assert_eq!</span>(num_bytes, <span class="number">0</span>);
<span class="macro">assert_eq!</span>(buf, <span class="string">""</span>);</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.split" class="method"><a class="src rightside" href="../../src/tokio/io/util/async_buf_read_ext.rs.html#240-245">Source</a><h4 class="code-header">fn <a href="#method.split" class="fn">split</a>(self, byte: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>) -&gt; <a class="struct" href="struct.Split.html" title="struct tokio::io::Split">Split</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> + <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"><p>Returns a stream of the contents of this reader split on the byte
<code>byte</code>.</p>
<p>This method is the asynchronous equivalent to
<a href="https://doc.rust-lang.org/1.93.1/std/io/trait.BufRead.html#method.split" title="method std::io::BufRead::split"><code>BufRead::split</code></a>.</p>
<p>The stream returned from this function will yield instances of
<a href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result"><code>io::Result</code></a><code>&lt;</code><a href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option"><code>Option</code></a><code>&lt;</code><a href="https://doc.rust-lang.org/1.93.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec"><code>Vec&lt;u8&gt;</code></a><code>&gt;&gt;</code>. Each vector returned will <em>not</em> have
the delimiter byte at the end.</p>
<h5 id="errors-2"><a class="doc-anchor" href="#errors-2">§</a>Errors</h5>
<p>Each item of the stream has the same error semantics as
<a href="trait.AsyncBufReadExt.html#method.read_until" title="method tokio::io::AsyncBufReadExt::read_until"><code>AsyncBufReadExt::read_until</code></a>.</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::io::AsyncBufReadExt;
<span class="kw">let </span><span class="kw-2">mut </span>segments = my_buf_read.split(<span class="string">b'f'</span>);
<span class="kw">while let </span><span class="prelude-val">Some</span>(segment) = segments.next_segment().<span class="kw">await</span><span class="question-mark">? </span>{
<span class="macro">println!</span>(<span class="string">"length = {}"</span>, segment.len())
}</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.fill_buf" class="method"><a class="src rightside" href="../../src/tokio/io/util/async_buf_read_ext.rs.html#277-282">Source</a><h4 class="code-header">fn <a href="#method.fill_buf" class="fn">fill_buf</a>(&amp;mut self) -&gt; FillBuf&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"><p>Returns the contents of the internal buffer, filling it with more
data from the inner reader if it is empty.</p>
<p>This function is a lower-level call. It needs to be paired with the
<a href="trait.AsyncBufReadExt.html#method.consume" title="method tokio::io::AsyncBufReadExt::consume"><code>consume</code></a> method to function properly. When calling this method,
none of the contents will be “read” in the sense that later calling
<code>read</code> may return the same contents. As such, <a href="trait.AsyncBufReadExt.html#method.consume" title="method tokio::io::AsyncBufReadExt::consume"><code>consume</code></a> must be
called with the number of bytes that are consumed from this buffer
to ensure that the bytes are never returned twice.</p>
<p>An empty buffer returned indicates that the stream has reached EOF.</p>
<p>Equivalent to:</p>
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested"></a><pre class="rust rust-example-rendered"><code><span class="kw">async fn </span>fill_buf(<span class="kw-2">&amp;mut </span><span class="self">self</span>) -&gt; io::Result&lt;<span class="kw-2">&amp;</span>[u8]&gt;;</code></pre></div><h5 id="errors-3"><a class="doc-anchor" href="#errors-3">§</a>Errors</h5>
<p>This function will return an I/O error if the underlying reader was
read, but returned an error.</p>
<h5 id="cancel-safety-2"><a class="doc-anchor" href="#cancel-safety-2">§</a>Cancel safety</h5>
<p>This method is cancel safe. If you use it as the event in a
<a href="../macro.select.html" title="macro tokio::select"><code>tokio::select!</code></a> statement and some other branch
completes first, then it is guaranteed that no data was read.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.consume" class="method"><a class="src rightside" href="../../src/tokio/io/util/async_buf_read_ext.rs.html#299-304">Source</a><h4 class="code-header">fn <a href="#method.consume" class="fn">consume</a>(&amp;mut self, amt: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>)<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"><p>Tells this buffer that <code>amt</code> bytes have been consumed from the
buffer, so they should no longer be returned in calls to <a href="trait.AsyncReadExt.html#method.read" title="method tokio::io::AsyncReadExt::read"><code>read</code></a>.</p>
<p>This function is a lower-level call. It needs to be paired with the
<a href="trait.AsyncBufReadExt.html#method.fill_buf" title="method tokio::io::AsyncBufReadExt::fill_buf"><code>fill_buf</code></a> method to function properly. This function does not
perform any I/O, it simply informs this object that some amount of
its buffer, returned from <a href="trait.AsyncBufReadExt.html#method.fill_buf" title="method tokio::io::AsyncBufReadExt::fill_buf"><code>fill_buf</code></a>, has been consumed and should
no longer be returned. As such, this function may do odd things if
<a href="trait.AsyncBufReadExt.html#method.fill_buf" title="method tokio::io::AsyncBufReadExt::fill_buf"><code>fill_buf</code></a> isnt called before calling it.</p>
<p>The <code>amt</code> must be less than the number of bytes in the buffer
returned by <a href="trait.AsyncBufReadExt.html#method.fill_buf" title="method tokio::io::AsyncBufReadExt::fill_buf"><code>fill_buf</code></a>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.lines" class="method"><a class="src rightside" href="../../src/tokio/io/util/async_buf_read_ext.rs.html#348-353">Source</a><h4 class="code-header">fn <a href="#method.lines" class="fn">lines</a>(self) -&gt; <a class="struct" href="struct.Lines.html" title="struct tokio::io::Lines">Lines</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"><p>Returns a stream over the lines of this reader.
This method is the async equivalent to <a href="https://doc.rust-lang.org/1.93.1/std/io/trait.BufRead.html#method.lines" title="method std::io::BufRead::lines"><code>BufRead::lines</code></a>.</p>
<p>The stream returned from this function will yield instances of
<a href="https://doc.rust-lang.org/1.93.1/std/io/error/type.Result.html" title="type std::io::error::Result"><code>io::Result</code></a><code>&lt;</code><a href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option"><code>Option</code></a><code>&lt;</code><a href="https://doc.rust-lang.org/1.93.1/alloc/string/struct.String.html" title="struct alloc::string::String"><code>String</code></a><code>&gt;&gt;</code>. Each string returned will <em>not</em> have a newline
byte (the 0xA byte) or <code>CRLF</code> (0xD, 0xA bytes) at the end.</p>
<h5 id="errors-4"><a class="doc-anchor" href="#errors-4">§</a>Errors</h5>
<p>Each line of the stream has the same error semantics as <a href="trait.AsyncBufReadExt.html#method.read_line" title="method tokio::io::AsyncBufReadExt::read_line"><code>AsyncBufReadExt::read_line</code></a>.</p>
<h5 id="examples-3"><a class="doc-anchor" href="#examples-3">§</a>Examples</h5>
<p><a href="https://doc.rust-lang.org/1.93.1/std/io/cursor/struct.Cursor.html" title="struct std::io::cursor::Cursor"><code>std::io::Cursor</code></a> is a type that implements <code>BufRead</code>. In
this example, we use <a href="https://doc.rust-lang.org/1.93.1/std/io/cursor/struct.Cursor.html" title="struct std::io::cursor::Cursor"><code>Cursor</code></a> to iterate over all the lines in a byte
slice.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::io::AsyncBufReadExt;
<span class="kw">use </span>std::io::Cursor;
<span class="kw">let </span>cursor = Cursor::new(<span class="string">b"lorem\nipsum\r\ndolor"</span>);
<span class="kw">let </span><span class="kw-2">mut </span>lines = cursor.lines();
<span class="macro">assert_eq!</span>(lines.next_line().<span class="kw">await</span>.unwrap(), <span class="prelude-val">Some</span>(String::from(<span class="string">"lorem"</span>)));
<span class="macro">assert_eq!</span>(lines.next_line().<span class="kw">await</span>.unwrap(), <span class="prelude-val">Some</span>(String::from(<span class="string">"ipsum"</span>)));
<span class="macro">assert_eq!</span>(lines.next_line().<span class="kw">await</span>.unwrap(), <span class="prelude-val">Some</span>(String::from(<span class="string">"dolor"</span>)));
<span class="macro">assert_eq!</span>(lines.next_line().<span class="kw">await</span>.unwrap(), <span class="prelude-val">None</span>);</code></pre></div></div></details></div><h2 id="dyn-compatibility" class="section-header">Dyn Compatibility<a href="#dyn-compatibility" class="anchor">§</a></h2><div class="dyn-compatibility-info"><p>This trait is <b>not</b> <a href="https://doc.rust-lang.org/1.93.1/reference/items/traits.html#dyn-compatibility">dyn compatible</a>.</p><p><i>In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.</i></p></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-AsyncBufReadExt-for-R" class="impl"><a class="src rightside" href="../../src/tokio/io/util/async_buf_read_ext.rs.html#357">Source</a><a href="#impl-AsyncBufReadExt-for-R" class="anchor">§</a><h3 class="code-header">impl&lt;R: <a class="trait" href="trait.AsyncBufRead.html" title="trait tokio::io::AsyncBufRead">AsyncBufRead</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>&gt; <a class="trait" href="trait.AsyncBufReadExt.html" title="trait tokio::io::AsyncBufReadExt">AsyncBufReadExt</a> for R</h3></section></div><script src="../../trait.impl/tokio/io/util/async_buf_read_ext/trait.AsyncBufReadExt.js" async></script></section></div></main></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,51 @@
<!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="An extension trait that adds utility methods to `AsyncSeek` types."><title>AsyncSeekExt in tokio::io - 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 trait"><!--[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="#">AsyncSeekExt</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="#">Async<wbr>Seek<wbr>Ext</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#examples" title="Examples">Examples</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.rewind" title="rewind">rewind</a></li><li><a href="#method.seek" title="seek">seek</a></li><li><a href="#method.stream_position" title="stream_position">stream_position</a></li></ul><h3><a href="#dyn-compatibility">Dyn Compatibility</a></h3><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>io</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">io</a></div><h1>Trait <span class="trait">Async<wbr>Seek<wbr>Ext</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/io/util/async_seek_ext.rs.html#33-93">Source</a> </span></div><pre class="rust item-decl"><code>pub trait AsyncSeekExt: <a class="trait" href="trait.AsyncSeek.html" title="trait tokio::io::AsyncSeek">AsyncSeek</a> {
// Provided methods
fn <a href="#method.seek" class="fn">seek</a>(&amp;mut self, pos: <a class="enum" href="https://doc.rust-lang.org/1.93.1/std/io/enum.SeekFrom.html" title="enum std::io::SeekFrom">SeekFrom</a>) -&gt; Seek&lt;'_, Self&gt;
<span 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></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.rewind" class="fn">rewind</a>(&amp;mut self) -&gt; Seek&lt;'_, Self&gt;
<span 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></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.stream_position" class="fn">stream_position</a>(&amp;mut self) -&gt; Seek&lt;'_, Self&gt;
<span 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></span> { ... }
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>An extension trait that adds utility methods to <a href="trait.AsyncSeek.html" title="trait tokio::io::AsyncSeek"><code>AsyncSeek</code></a> types.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::io::{<span class="self">self</span>, Cursor, SeekFrom};
<span class="kw">use </span>tokio::io::{AsyncSeekExt, AsyncReadExt};
<span class="kw">let </span><span class="kw-2">mut </span>cursor = Cursor::new(<span class="string">b"abcdefg"</span>);
<span class="comment">// the `seek` method is defined by this trait
</span>cursor.seek(SeekFrom::Start(<span class="number">3</span>)).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="kw">let </span><span class="kw-2">mut </span>buf = [<span class="number">0</span>; <span class="number">1</span>];
<span class="kw">let </span>n = cursor.read(<span class="kw-2">&amp;mut </span>buf).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="macro">assert_eq!</span>(n, <span class="number">1</span>);
<span class="macro">assert_eq!</span>(buf, [<span class="string">b'd'</span>]);
<span class="prelude-val">Ok</span>(())</code></pre></div>
<p>See <a href="index.html" title="mod tokio::io">module</a> documentation for more details.</p>
</div></details><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.seek" class="method"><a class="src rightside" href="../../src/tokio/io/util/async_seek_ext.rs.html#66-71">Source</a><h4 class="code-header">fn <a href="#method.seek" class="fn">seek</a>(&amp;mut self, pos: <a class="enum" href="https://doc.rust-lang.org/1.93.1/std/io/enum.SeekFrom.html" title="enum std::io::SeekFrom">SeekFrom</a>) -&gt; Seek&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"><p>Creates a future which will seek an IO object, and then yield the
new position in the object and the object itself.</p>
<p>Equivalent to:</p>
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested"></a><pre class="rust rust-example-rendered"><code><span class="kw">async fn </span>seek(<span class="kw-2">&amp;mut </span><span class="self">self</span>, pos: SeekFrom) -&gt; io::Result&lt;u64&gt;;</code></pre></div>
<p>In the case of an error the buffer and the object will be discarded, with
the error yielded.</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::fs::File;
<span class="kw">use </span>tokio::io::{AsyncSeekExt, AsyncReadExt};
<span class="kw">use </span>std::io::SeekFrom;
<span class="kw">let </span><span class="kw-2">mut </span>file = File::open(<span class="string">"foo.txt"</span>).<span class="kw">await</span><span class="question-mark">?</span>;
file.seek(SeekFrom::Start(<span class="number">6</span>)).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="kw">let </span><span class="kw-2">mut </span>contents = <span class="macro">vec!</span>[<span class="number">0u8</span>; <span class="number">10</span>];
file.read_exact(<span class="kw-2">&amp;mut </span>contents).<span class="kw">await</span><span class="question-mark">?</span>;</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.rewind" class="method"><a class="src rightside" href="../../src/tokio/io/util/async_seek_ext.rs.html#76-81">Source</a><h4 class="code-header">fn <a href="#method.rewind" class="fn">rewind</a>(&amp;mut self) -&gt; Seek&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"><p>Creates a future which will rewind to the beginning of the stream.</p>
<p>This is convenience method, equivalent to <code>self.seek(SeekFrom::Start(0))</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.stream_position" class="method"><a class="src rightside" href="../../src/tokio/io/util/async_seek_ext.rs.html#87-92">Source</a><h4 class="code-header">fn <a href="#method.stream_position" class="fn">stream_position</a>(&amp;mut self) -&gt; Seek&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"><p>Creates a future which will return the current seek position from the
start of the stream.</p>
<p>This is equivalent to <code>self.seek(SeekFrom::Current(0))</code>.</p>
</div></details></div><h2 id="dyn-compatibility" class="section-header">Dyn Compatibility<a href="#dyn-compatibility" class="anchor">§</a></h2><div class="dyn-compatibility-info"><p>This trait is <b>not</b> <a href="https://doc.rust-lang.org/1.93.1/reference/items/traits.html#dyn-compatibility">dyn compatible</a>.</p><p><i>In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.</i></p></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-AsyncSeekExt-for-S" class="impl"><a class="src rightside" href="../../src/tokio/io/util/async_seek_ext.rs.html#96">Source</a><a href="#impl-AsyncSeekExt-for-S" class="anchor">§</a><h3 class="code-header">impl&lt;S: <a class="trait" href="trait.AsyncSeek.html" title="trait tokio::io::AsyncSeek">AsyncSeek</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>&gt; <a class="trait" href="trait.AsyncSeekExt.html" title="trait tokio::io::AsyncSeekExt">AsyncSeekExt</a> for S</h3></section></div><script src="../../trait.impl/tokio/io/util/async_seek_ext/trait.AsyncSeekExt.js" async></script></section></div></main></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,10 @@
<!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="Asynchronous IO structures specific to Unix-like operating systems."><title>tokio::io::unix - 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 mod"><!--[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="#">Module unix</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="#">Module unix</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In tokio::<wbr>io</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">io</a></div><h1>Module <span>unix</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/io/mod.rs.html#258">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Asynchronous IO structures specific to Unix-like operating systems.</p>
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.AsyncFd.html" title="struct tokio::io::unix::AsyncFd">AsyncFd</a></dt><dd>Associates an IO object backed by a Unix file descriptor with the tokio
reactor, allowing for readiness to be polled. The file descriptor must be of
a type that can be used with the OS polling facilities (ie, <code>poll</code>, <code>epoll</code>,
<code>kqueue</code>, etc), such as a network socket or pipe, and the file descriptor
must have the nonblocking mode set to true.</dd><dt><a class="struct" href="struct.AsyncFdReadyGuard.html" title="struct tokio::io::unix::AsyncFdReadyGuard">Async<wbr>FdReady<wbr>Guard</a></dt><dd>Represents an IO-ready event detected on a particular file descriptor that
has not yet been acknowledged. This is a <code>must_use</code> structure to help ensure
that you do not forget to explicitly clear (or not clear) the event.</dd><dt><a class="struct" href="struct.AsyncFdReadyMutGuard.html" title="struct tokio::io::unix::AsyncFdReadyMutGuard">Async<wbr>FdReady<wbr>MutGuard</a></dt><dd>Represents an IO-ready event detected on a particular file descriptor that
has not yet been acknowledged. This is a <code>must_use</code> structure to help ensure
that you do not forget to explicitly clear (or not clear) the event.</dd><dt><a class="struct" href="struct.AsyncFdTryNewError.html" title="struct tokio::io::unix::AsyncFdTryNewError">Async<wbr>FdTry<wbr>NewError</a></dt><dd>Error returned by <a href="struct.AsyncFd.html#method.try_new" title="associated function tokio::io::unix::AsyncFd::try_new"><code>try_new</code></a> or <a href="struct.AsyncFd.html#method.try_with_interest" title="associated function tokio::io::unix::AsyncFd::try_with_interest"><code>try_with_interest</code></a>.</dd><dt><a class="struct" href="struct.TryIoError.html" title="struct tokio::io::unix::TryIoError">TryIo<wbr>Error</a></dt><dd>The error type returned by <a href="struct.AsyncFdReadyGuard.html#method.try_io" title="method tokio::io::unix::AsyncFdReadyGuard::try_io"><code>try_io</code></a>.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":["AsyncFd","AsyncFdReadyGuard","AsyncFdReadyMutGuard","AsyncFdTryNewError","TryIoError"]};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,13 @@
<!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="The error type returned by `try_io`."><title>TryIoError in tokio::io::unix - 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="#">TryIoError</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="#">TryIo<wbr>Error</a></h2><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-Debug-for-TryIoError" title="Debug">Debug</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-Freeze-for-TryIoError" title="Freeze">Freeze</a></li><li><a href="#impl-RefUnwindSafe-for-TryIoError" title="RefUnwindSafe">RefUnwindSafe</a></li><li><a href="#impl-Send-for-TryIoError" title="Send">Send</a></li><li><a href="#impl-Sync-for-TryIoError" title="Sync">Sync</a></li><li><a href="#impl-Unpin-for-TryIoError" title="Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe-for-TryIoError" 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-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>io::<wbr>unix</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">io</a>::<wbr><a href="index.html">unix</a></div><h1>Struct <span class="struct">TryIo<wbr>Error</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/io/async_fd.rs.html#1395">Source</a> </span></div><pre class="rust item-decl"><code>pub struct TryIoError(<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>The error type returned by <a href="struct.AsyncFdReadyGuard.html#method.try_io" title="method tokio::io::unix::AsyncFdReadyGuard::try_io"><code>try_io</code></a>.</p>
<p>This error indicates that the IO resource returned a <a href="https://doc.rust-lang.org/1.93.1/std/io/error/enum.ErrorKind.html#variant.WouldBlock" title="variant std::io::error::ErrorKind::WouldBlock"><code>WouldBlock</code></a> error.</p>
</div></details><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-Debug-for-TryIoError" class="impl"><a class="src rightside" href="../../../src/tokio/io/async_fd.rs.html#1394">Source</a><a href="#impl-Debug-for-TryIoError" 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.TryIoError.html" title="struct tokio::io::unix::TryIoError">TryIoError</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/io/async_fd.rs.html#1394">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></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-TryIoError" class="impl"><a href="#impl-Freeze-for-TryIoError" 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.TryIoError.html" title="struct tokio::io::unix::TryIoError">TryIoError</a></h3></section><section id="impl-RefUnwindSafe-for-TryIoError" class="impl"><a href="#impl-RefUnwindSafe-for-TryIoError" 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.TryIoError.html" title="struct tokio::io::unix::TryIoError">TryIoError</a></h3></section><section id="impl-Send-for-TryIoError" class="impl"><a href="#impl-Send-for-TryIoError" 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.TryIoError.html" title="struct tokio::io::unix::TryIoError">TryIoError</a></h3></section><section id="impl-Sync-for-TryIoError" class="impl"><a href="#impl-Sync-for-TryIoError" 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.TryIoError.html" title="struct tokio::io::unix::TryIoError">TryIoError</a></h3></section><section id="impl-Unpin-for-TryIoError" class="impl"><a href="#impl-Unpin-for-TryIoError" 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.TryIoError.html" title="struct tokio::io::unix::TryIoError">TryIoError</a></h3></section><section id="impl-UnwindSafe-for-TryIoError" class="impl"><a href="#impl-UnwindSafe-for-TryIoError" 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.TryIoError.html" title="struct tokio::io::unix::TryIoError">TryIoError</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-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-1" 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-1" 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" 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" 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" 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" 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>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../tokio/io/trait.AsyncBufReadExt.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../tokio/io/trait.AsyncBufReadExt.html">../../../../tokio/io/trait.AsyncBufReadExt.html</a>...</p>
<script>location.replace("../../../../tokio/io/trait.AsyncBufReadExt.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../tokio/io/trait.AsyncReadExt.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../tokio/io/trait.AsyncReadExt.html">../../../../tokio/io/trait.AsyncReadExt.html</a>...</p>
<script>location.replace("../../../../tokio/io/trait.AsyncReadExt.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../tokio/io/trait.AsyncSeekExt.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../tokio/io/trait.AsyncSeekExt.html">../../../../tokio/io/trait.AsyncSeekExt.html</a>...</p>
<script>location.replace("../../../../tokio/io/trait.AsyncSeekExt.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../tokio/io/trait.AsyncWriteExt.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../tokio/io/trait.AsyncWriteExt.html">../../../../tokio/io/trait.AsyncWriteExt.html</a>...</p>
<script>location.replace("../../../../tokio/io/trait.AsyncWriteExt.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../tokio/io/struct.BufReader.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../tokio/io/struct.BufReader.html">../../../../tokio/io/struct.BufReader.html</a>...</p>
<script>location.replace("../../../../tokio/io/struct.BufReader.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../tokio/io/struct.BufStream.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../tokio/io/struct.BufStream.html">../../../../tokio/io/struct.BufStream.html</a>...</p>
<script>location.replace("../../../../tokio/io/struct.BufStream.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../tokio/io/struct.BufWriter.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../tokio/io/struct.BufWriter.html">../../../../tokio/io/struct.BufWriter.html</a>...</p>
<script>location.replace("../../../../tokio/io/struct.BufWriter.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../tokio/io/struct.Chain.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../tokio/io/struct.Chain.html">../../../../tokio/io/struct.Chain.html</a>...</p>
<script>location.replace("../../../../tokio/io/struct.Chain.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../tokio/io/fn.copy.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../tokio/io/fn.copy.html">../../../../tokio/io/fn.copy.html</a>...</p>
<script>location.replace("../../../../tokio/io/fn.copy.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../tokio/io/fn.copy_bidirectional.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../tokio/io/fn.copy_bidirectional.html">../../../../tokio/io/fn.copy_bidirectional.html</a>...</p>
<script>location.replace("../../../../tokio/io/fn.copy_bidirectional.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../tokio/io/fn.copy_bidirectional_with_sizes.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../tokio/io/fn.copy_bidirectional_with_sizes.html">../../../../tokio/io/fn.copy_bidirectional_with_sizes.html</a>...</p>
<script>location.replace("../../../../tokio/io/fn.copy_bidirectional_with_sizes.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../tokio/io/fn.copy_buf.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../tokio/io/fn.copy_buf.html">../../../../tokio/io/fn.copy_buf.html</a>...</p>
<script>location.replace("../../../../tokio/io/fn.copy_buf.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../tokio/io/fn.empty.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../tokio/io/fn.empty.html">../../../../tokio/io/fn.empty.html</a>...</p>
<script>location.replace("../../../../tokio/io/fn.empty.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../tokio/io/struct.Empty.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../tokio/io/struct.Empty.html">../../../../tokio/io/struct.Empty.html</a>...</p>
<script>location.replace("../../../../tokio/io/struct.Empty.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../tokio/io/struct.Lines.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../tokio/io/struct.Lines.html">../../../../tokio/io/struct.Lines.html</a>...</p>
<script>location.replace("../../../../tokio/io/struct.Lines.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../tokio/io/fn.duplex.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../tokio/io/fn.duplex.html">../../../../tokio/io/fn.duplex.html</a>...</p>
<script>location.replace("../../../../tokio/io/fn.duplex.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../tokio/io/fn.simplex.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../tokio/io/fn.simplex.html">../../../../tokio/io/fn.simplex.html</a>...</p>
<script>location.replace("../../../../tokio/io/fn.simplex.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../tokio/io/struct.DuplexStream.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../tokio/io/struct.DuplexStream.html">../../../../tokio/io/struct.DuplexStream.html</a>...</p>
<script>location.replace("../../../../tokio/io/struct.DuplexStream.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../tokio/io/struct.SimplexStream.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../tokio/io/struct.SimplexStream.html">../../../../tokio/io/struct.SimplexStream.html</a>...</p>
<script>location.replace("../../../../tokio/io/struct.SimplexStream.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../tokio/io/fn.repeat.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../tokio/io/fn.repeat.html">../../../../tokio/io/fn.repeat.html</a>...</p>
<script>location.replace("../../../../tokio/io/fn.repeat.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../tokio/io/struct.Repeat.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../tokio/io/struct.Repeat.html">../../../../tokio/io/struct.Repeat.html</a>...</p>
<script>location.replace("../../../../tokio/io/struct.Repeat.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../tokio/io/fn.sink.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../tokio/io/fn.sink.html">../../../../tokio/io/fn.sink.html</a>...</p>
<script>location.replace("../../../../tokio/io/fn.sink.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../tokio/io/struct.Sink.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../tokio/io/struct.Sink.html">../../../../tokio/io/struct.Sink.html</a>...</p>
<script>location.replace("../../../../tokio/io/struct.Sink.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../tokio/io/struct.Split.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../tokio/io/struct.Split.html">../../../../tokio/io/struct.Split.html</a>...</p>
<script>location.replace("../../../../tokio/io/struct.Split.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../tokio/io/struct.Take.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../tokio/io/struct.Take.html">../../../../tokio/io/struct.Take.html</a>...</p>
<script>location.replace("../../../../tokio/io/struct.Take.html" + location.search + location.hash);</script>
</body>
</html>