510 lines
453 KiB
HTML
510 lines
453 KiB
HTML
|
<!DOCTYPE html>
|
|||
|
<html lang="en">
|
|||
|
<head>
|
|||
|
<meta charset="utf-8">
|
|||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|||
|
<meta name="generator" content="rustdoc">
|
|||
|
<meta name="description" content="API documentation for the Rust `Read` trait in crate `tokio`.">
|
|||
|
<meta name="keywords" content="rust, rustlang, rust-lang, Read">
|
|||
|
|
|||
|
<title>tokio::prelude::Read - Rust</title>
|
|||
|
|
|||
|
<link rel="stylesheet" type="text/css" href="../../normalize.css">
|
|||
|
<link rel="stylesheet" type="text/css" href="../../rustdoc.css"
|
|||
|
id="mainThemeStyle">
|
|||
|
|
|||
|
<link rel="stylesheet" type="text/css" href="../../dark.css">
|
|||
|
<link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle">
|
|||
|
<script src="../../storage.js"></script>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
</head>
|
|||
|
<body class="rustdoc trait">
|
|||
|
<!--[if lte IE 8]>
|
|||
|
<div class="warning">
|
|||
|
This old browser is unsupported and will most likely display funky
|
|||
|
things.
|
|||
|
</div>
|
|||
|
<![endif]-->
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<nav class="sidebar">
|
|||
|
<div class="sidebar-menu">☰</div>
|
|||
|
|
|||
|
<p class='location'>Trait Read</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.read">read</a></div><a class="sidebar-title" href="#provided-methods">Provided Methods</a><div class="sidebar-links"><a href="#method.initializer">initializer</a><a href="#method.read_to_end">read_to_end</a><a href="#method.read_to_string">read_to_string</a><a href="#method.read_exact">read_exact</a><a href="#method.by_ref">by_ref</a><a href="#method.bytes">bytes</a><a href="#method.chars">chars</a><a href="#method.chain">chain</a><a href="#method.take">take</a></div><a class="sidebar-title" href="#foreign-impls">Implementations on Foreign Types</a><div class="sidebar-links"><a href="#impl-Read">Take<T></a><a href="#impl-Read">&'a File</a><a href="#impl-Read">Box<R></a><a href="#impl-Read">ChildStdout</a><a href="#impl-Read">StdinLock<'a></a><a href="#impl-Read">Empty</a><a href="#impl-Read">UnixStream</a><a href="#impl-Read">TcpStream</a><a href="#impl-Read">File</a><a href="#impl-Read">Repeat</a><a href="#impl-Read">&'a TcpStream</a><a href="#impl-Read">Chain<T, U></a><a href="#impl-Read">ChildStderr</a><a href="#impl-Read">&'a mut R</a><a href="#impl-Read">&'a UnixStream</a><a href="#impl-Read">&'a [u8]</a><a href="#impl-Read">Stdin</a><a href="#impl-Read">Cursor<T></a><a href="#impl-Read">BufReader<R></a><a href="#impl-Read">TcpStream</a><a href="#impl-Read">&'a TcpStream</a><a href="#impl-Read">AllowStdIo<T></a><a href="#impl-Read">Reader<B></a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='../index.html'>tokio</a>::<wbr><a href='index.html'>prelude</a></p><script>window.sidebarCurrent = {name: 'Read', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div>
|
|||
|
</nav>
|
|||
|
|
|||
|
<div class="theme-picker">
|
|||
|
<button id="theme-picker" aria-label="Pick another theme!">
|
|||
|
<img src="../../brush.svg" width="18" alt="Pick another theme!">
|
|||
|
</button>
|
|||
|
<div id="theme-choices"></div>
|
|||
|
</div>
|
|||
|
<script src="../../theme.js"></script>
|
|||
|
<nav class="sub">
|
|||
|
<form class="search-form js-only">
|
|||
|
<div class="search-container">
|
|||
|
<input class="search-input" name="search"
|
|||
|
autocomplete="off"
|
|||
|
placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
|
|||
|
type="search">
|
|||
|
</div>
|
|||
|
</form>
|
|||
|
</nav>
|
|||
|
|
|||
|
<section id='main' class="content"><h1 class='fqn'><span class='in-band'>Trait <a href='../index.html'>tokio</a>::<wbr><a href='index.html'>prelude</a>::<wbr><a class="trait" href=''>Read</a></span><span class='out-of-band'><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><span id='render-detail'>
|
|||
|
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
|
|||
|
[<span class='inner'>−</span>]
|
|||
|
</a>
|
|||
|
</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#470-907' title='goto source code'>[src]</a></span></h1><div class="docblock type-decl"><pre class='rust trait'>pub trait Read {
|
|||
|
fn <a href='#tymethod.read' class='fnname'>read</a>(&mut self, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="struct" href="../../tokio/io/struct.Error.html" title="struct tokio::io::Error">Error</a>>;
|
|||
|
|
|||
|
unsafe fn <a href='#method.initializer' class='fnname'>initializer</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Initializer.html" title="struct std::io::Initializer">Initializer</a> { ... }
|
|||
|
<div class='item-spacer'></div> fn <a href='#method.read_to_end' class='fnname'>read_to_end</a>(&mut self, buf: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="struct" href="../../tokio/io/struct.Error.html" title="struct tokio::io::Error">Error</a>> { ... }
|
|||
|
<div class='item-spacer'></div> fn <a href='#method.read_to_string' class='fnname'>read_to_string</a>(&mut self, buf: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="struct" href="../../tokio/io/struct.Error.html" title="struct tokio::io::Error">Error</a>> { ... }
|
|||
|
<div class='item-spacer'></div> fn <a href='#method.read_exact' class='fnname'>read_exact</a>(&mut self, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="../../tokio/io/struct.Error.html" title="struct tokio::io::Error">Error</a>> { ... }
|
|||
|
<div class='item-spacer'></div> fn <a href='#method.by_ref' class='fnname'>by_ref</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>Self { ... }
|
|||
|
<div class='item-spacer'></div> fn <a href='#method.bytes' class='fnname'>bytes</a>(self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Bytes.html" title="struct std::io::Bytes">Bytes</a><Self> { ... }
|
|||
|
<div class='item-spacer'></div> fn <a href='#method.chars' class='fnname'>chars</a>(self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chars.html" title="struct std::io::Chars">Chars</a><Self> { ... }
|
|||
|
<div class='item-spacer'></div> fn <a href='#method.chain' class='fnname'>chain</a><R>(self, next: R) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><Self, R><br> <span class="where">where<br> R: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a></span>,
|
|||
|
{ ... }
|
|||
|
<div class='item-spacer'></div> fn <a href='#method.take' class='fnname'>take</a>(self, limit: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><Self> { ... }
|
|||
|
}</pre></div><div class='docblock'><p>The <code>Read</code> trait allows for reading bytes from a source.</p>
|
|||
|
<p>Implementors of the <code>Read</code> trait are called 'readers'.</p>
|
|||
|
<p>Readers are defined by one required method, <a href="trait.Read.html#tymethod.read"><code>read()</code></a>. Each call to <a href="trait.Read.html#tymethod.read"><code>read()</code></a>
|
|||
|
will attempt to pull bytes from this source into a provided buffer. A
|
|||
|
number of other methods are implemented in terms of <a href="trait.Read.html#tymethod.read"><code>read()</code></a>, giving
|
|||
|
implementors a number of ways to read bytes while only needing to implement
|
|||
|
a single method.</p>
|
|||
|
<p>Readers are intended to be composable with one another. Many implementors
|
|||
|
throughout <a href="../../std/io/index.html"><code>std::io</code></a> take and provide types which implement the <code>Read</code>
|
|||
|
trait.</p>
|
|||
|
<p>Please note that each call to <a href="trait.Read.html#tymethod.read"><code>read()</code></a> may involve a system call, and
|
|||
|
therefore, using something that implements <a href="trait.BufRead.html"><code>BufRead</code></a>, such as
|
|||
|
<a href="struct.BufReader.html"><code>BufReader</code></a>, will be more efficient.</p>
|
|||
|
<h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1>
|
|||
|
<p><a href="../fs/struct.File.html"><code>File</code></a>s implement <code>Read</code>:</p>
|
|||
|
|
|||
|
<pre class="rust rust-example-rendered">
|
|||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">io</span>;
|
|||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">io</span>::<span class="ident">prelude</span>::<span class="kw-2">*</span>;
|
|||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fs</span>::<span class="ident">File</span>;
|
|||
|
|
|||
|
<span class="kw">fn</span> <span class="ident">main</span>() <span class="op">-></span> <span class="ident">io</span>::<span class="prelude-ty">Result</span><span class="op"><</span>()<span class="op">></span> {
|
|||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">f</span> <span class="op">=</span> <span class="ident">File</span>::<span class="ident">open</span>(<span class="string">"foo.txt"</span>)<span class="question-mark">?</span>;
|
|||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">buffer</span> <span class="op">=</span> [<span class="number">0</span>; <span class="number">10</span>];
|
|||
|
|
|||
|
<span class="comment">// read up to 10 bytes</span>
|
|||
|
<span class="ident">f</span>.<span class="ident">read</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">buffer</span>)<span class="question-mark">?</span>;
|
|||
|
|
|||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">buffer</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</span>[<span class="number">0</span>; <span class="number">10</span>];
|
|||
|
<span class="comment">// read the whole file</span>
|
|||
|
<span class="ident">f</span>.<span class="ident">read_to_end</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">buffer</span>)<span class="question-mark">?</span>;
|
|||
|
|
|||
|
<span class="comment">// read into a String, so that you don't need to do the conversion.</span>
|
|||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">buffer</span> <span class="op">=</span> <span class="ident">String</span>::<span class="ident">new</span>();
|
|||
|
<span class="ident">f</span>.<span class="ident">read_to_string</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">buffer</span>)<span class="question-mark">?</span>;
|
|||
|
|
|||
|
<span class="comment">// and more! See the other methods for more details.</span>
|
|||
|
<span class="prelude-val">Ok</span>(())
|
|||
|
}</pre>
|
|||
|
<p>Read from <a href="../../std/primitive.str.html"><code>&str</code></a> because <a href="../../std/primitive.slice.html"><code>&[u8]</code></a> implements <code>Read</code>:</p>
|
|||
|
|
|||
|
<pre class="rust rust-example-rendered">
|
|||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">io</span>::<span class="ident">prelude</span>::<span class="kw-2">*</span>;
|
|||
|
|
|||
|
<span class="kw">fn</span> <span class="ident">main</span>() <span class="op">-></span> <span class="ident">io</span>::<span class="prelude-ty">Result</span><span class="op"><</span>()<span class="op">></span> {
|
|||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">b</span> <span class="op">=</span> <span class="string">"This string will be read"</span>.<span class="ident">as_bytes</span>();
|
|||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">buffer</span> <span class="op">=</span> [<span class="number">0</span>; <span class="number">10</span>];
|
|||
|
|
|||
|
<span class="comment">// read up to 10 bytes</span>
|
|||
|
<span class="ident">b</span>.<span class="ident">read</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">buffer</span>)<span class="question-mark">?</span>;
|
|||
|
|
|||
|
<span class="comment">// etc... it works exactly as a File does!</span>
|
|||
|
<span class="prelude-val">Ok</span>(())
|
|||
|
}</pre>
|
|||
|
</div>
|
|||
|
<h2 id='required-methods' class='small-section-header'>
|
|||
|
Required Methods<a href='#required-methods' class='anchor'></a>
|
|||
|
</h2>
|
|||
|
<div class='methods'>
|
|||
|
<h3 id='tymethod.read' class='method'><span id='read.v' class='invisible'><code>fn <a href='#tymethod.read' class='fnname'>read</a>(&mut self, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="struct" href="../../tokio/io/struct.Error.html" title="struct tokio::io::Error">Error</a>></code></span></h3><div class='docblock'><p>Pull some bytes from this source into the specified buffer, returning
|
|||
|
how many bytes were read.</p>
|
|||
|
<p>This function does not provide any guarantees about whether it blocks
|
|||
|
waiting for data, but if an object needs to block for a read but cannot
|
|||
|
it will typically signal this via an <a href="../../std/result/enum.Result.html#variant.Err"><code>Err</code></a> return value.</p>
|
|||
|
<p>If the return value of this method is <a href="../../std/result/enum.Result.html#variant.Ok"><code>Ok(n)</code></a>, then it must be
|
|||
|
guaranteed that <code>0 <= n <= buf.len()</code>. A nonzero <code>n</code> value indicates
|
|||
|
that the buffer <code>buf</code> has been filled in with <code>n</code> bytes of data from this
|
|||
|
source. If <code>n</code> is <code>0</code>, then it can indicate one of two scenarios:</p>
|
|||
|
<ol>
|
|||
|
<li>This reader has reached its "end of file" and will likely no longer
|
|||
|
be able to produce bytes. Note that this does not mean that the
|
|||
|
reader will <em>always</em> no longer be able to produce bytes.</li>
|
|||
|
<li>The buffer specified was 0 bytes in length.</li>
|
|||
|
</ol>
|
|||
|
<p>No guarantees are provided about the contents of <code>buf</code> when this
|
|||
|
function is called, implementations cannot rely on any property of the
|
|||
|
contents of <code>buf</code> being true. It is recommended that implementations
|
|||
|
only write data to <code>buf</code> instead of reading its contents.</p>
|
|||
|
<h1 id="errors" class="section-header"><a href="#errors">Errors</a></h1>
|
|||
|
<p>If this function encounters any form of I/O or other error, an error
|
|||
|
variant will be returned. If an error is returned then it must be
|
|||
|
guaranteed that no bytes were read.</p>
|
|||
|
<p>An error of the <a href="../../std/io/enum.ErrorKind.html#variant.Interrupted"><code>ErrorKind::Interrupted</code></a> kind is non-fatal and the read
|
|||
|
operation should be retried if there is nothing else to do.</p>
|
|||
|
<h1 id="examples-1" class="section-header"><a href="#examples-1">Examples</a></h1>
|
|||
|
<p><a href="../fs/struct.File.html"><code>File</code></a>s implement <code>Read</code>:</p>
|
|||
|
|
|||
|
<pre class="rust rust-example-rendered">
|
|||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">io</span>;
|
|||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">io</span>::<span class="ident">prelude</span>::<span class="kw-2">*</span>;
|
|||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fs</span>::<span class="ident">File</span>;
|
|||
|
|
|||
|
<span class="kw">fn</span> <span class="ident">main</span>() <span class="op">-></span> <span class="ident">io</span>::<span class="prelude-ty">Result</span><span class="op"><</span>()<span class="op">></span> {
|
|||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">f</span> <span class="op">=</span> <span class="ident">File</span>::<span class="ident">open</span>(<span class="string">"foo.txt"</span>)<span class="question-mark">?</span>;
|
|||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">buffer</span> <span class="op">=</span> [<span class="number">0</span>; <span class="number">10</span>];
|
|||
|
|
|||
|
<span class="comment">// read up to 10 bytes</span>
|
|||
|
<span class="ident">f</span>.<span class="ident">read</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">buffer</span>[..])<span class="question-mark">?</span>;
|
|||
|
<span class="prelude-val">Ok</span>(())
|
|||
|
}</pre>
|
|||
|
</div></div>
|
|||
|
<h2 id='provided-methods' class='small-section-header'>
|
|||
|
Provided Methods<a href='#provided-methods' class='anchor'></a>
|
|||
|
</h2>
|
|||
|
<div class='methods'>
|
|||
|
<h3 id='method.initializer' class='method'><span id='initializer.v' class='invisible'><code>unsafe fn <a href='#method.initializer' class='fnname'>initializer</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Initializer.html" title="struct std::io::Initializer">Initializer</a></code></span></h3><div class='stability'><div class='stab unstable'><span class=microscope>🔬</span> This is a nightly-only experimental API. (<code>read_initializer</code>)</div></div><div class='docblock'><p>Determines if this <code>Read</code>er can work with buffers of uninitialized
|
|||
|
memory.</p>
|
|||
|
<p>The default implementation returns an initializer which will zero
|
|||
|
buffers.</p>
|
|||
|
<p>If a <code>Read</code>er guarantees that it can work properly with uninitialized
|
|||
|
memory, it should call <a href="../../std/io/struct.Initializer.html#method.nop"><code>Initializer::nop()</code></a>. See the documentation for
|
|||
|
<a href="../../std/io/struct.Initializer.html"><code>Initializer</code></a> for details.</p>
|
|||
|
<p>The behavior of this method must be independent of the state of the
|
|||
|
<code>Read</code>er - the method only takes <code>&self</code> so that it can be used through
|
|||
|
trait objects.</p>
|
|||
|
<h1 id="safety" class="section-header"><a href="#safety">Safety</a></h1>
|
|||
|
<p>This method is unsafe because a <code>Read</code>er could otherwise return a
|
|||
|
non-zeroing <code>Initializer</code> from another <code>Read</code> type without an <code>unsafe</code>
|
|||
|
block.</p>
|
|||
|
</div><h3 id='method.read_to_end' class='method'><span id='read_to_end.v' class='invisible'><code>fn <a href='#method.read_to_end' class='fnname'>read_to_end</a>(&mut self, buf: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="struct" href="../../tokio/io/struct.Error.html" title="struct tokio::io::Error">Error</a>></code></span></h3><div class='docblock'><p>Read all bytes until EOF in this source, placing them into <code>buf</code>.</p>
|
|||
|
<p>All bytes read from this source will be appended to the specified buffer
|
|||
|
<code>buf</code>. This function will continuously call <a href="trait.Read.html#tymethod.read"><code>read()</code></a> to append more data to
|
|||
|
<code>buf</code> until <a href="trait.Read.html#tymethod.read"><code>read()</code></a> returns either <a href="../../std/result/enum.Result.html#variant.Ok"><code>Ok(0)</code></a> or an error of
|
|||
|
non-<a href="../../std/io/enum.ErrorKind.html#variant.Interrupted"><code>ErrorKind::Interrupted</code></a> kind.</p>
|
|||
|
<p>If successful, this function will return the total number of bytes read.</p>
|
|||
|
<h1 id="errors-1" class="section-header"><a href="#errors-1">Errors</a></h1>
|
|||
|
<p>If this function encounters an error of the kind
|
|||
|
<a href="../../std/io/enum.ErrorKind.html#variant.Interrupted"><code>ErrorKind::Interrupted</code></a> then the error is ignored and the operation
|
|||
|
will continue.</p>
|
|||
|
<p>If any other read error is encountered then this function immediately
|
|||
|
returns. Any bytes which have already been read will be appended to
|
|||
|
<code>buf</code>.</p>
|
|||
|
<h1 id="examples-2" class="section-header"><a href="#examples-2">Examples</a></h1>
|
|||
|
<p><a href="../fs/struct.File.html"><code>File</code></a>s implement <code>Read</code>:</p>
|
|||
|
|
|||
|
<pre class="rust rust-example-rendered">
|
|||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">io</span>;
|
|||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">io</span>::<span class="ident">prelude</span>::<span class="kw-2">*</span>;
|
|||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fs</span>::<span class="ident">File</span>;
|
|||
|
|
|||
|
<span class="kw">fn</span> <span class="ident">main</span>() <span class="op">-></span> <span class="ident">io</span>::<span class="prelude-ty">Result</span><span class="op"><</span>()<span class="op">></span> {
|
|||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">f</span> <span class="op">=</span> <span class="ident">File</span>::<span class="ident">open</span>(<span class="string">"foo.txt"</span>)<span class="question-mark">?</span>;
|
|||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">buffer</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">new</span>();
|
|||
|
|
|||
|
<span class="comment">// read the whole file</span>
|
|||
|
<span class="ident">f</span>.<span class="ident">read_to_end</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">buffer</span>)<span class="question-mark">?</span>;
|
|||
|
<span class="prelude-val">Ok</span>(())
|
|||
|
}</pre>
|
|||
|
</div><h3 id='method.read_to_string' class='method'><span id='read_to_string.v' class='invisible'><code>fn <a href='#method.read_to_string' class='fnname'>read_to_string</a>(&mut self, buf: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="struct" href="../../tokio/io/struct.Error.html" title="struct tokio::io::Error">Error</a>></code></span></h3><div class='docblock'><p>Read all bytes until EOF in this source, appending them to <code>buf</code>.</p>
|
|||
|
<p>If successful, this function returns the number of bytes which were read
|
|||
|
and appended to <code>buf</code>.</p>
|
|||
|
<h1 id="errors-2" class="section-header"><a href="#errors-2">Errors</a></h1>
|
|||
|
<p>If the data in this stream is <em>not</em> valid UTF-8 then an error is
|
|||
|
returned and <code>buf</code> is unchanged.</p>
|
|||
|
<p>See <a href="#method.read_to_end"><code>read_to_end</code></a> for other error semantics.</p>
|
|||
|
<h1 id="examples-3" class="section-header"><a href="#examples-3">Examples</a></h1>
|
|||
|
<p><a href="../fs/struct.File.html"><code>File</code></a>s implement <code>Read</code>:</p>
|
|||
|
|
|||
|
<pre class="rust rust-example-rendered">
|
|||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">io</span>;
|
|||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">io</span>::<span class="ident">prelude</span>::<span class="kw-2">*</span>;
|
|||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fs</span>::<span class="ident">File</span>;
|
|||
|
|
|||
|
<span class="kw">fn</span> <span class="ident">main</span>() <span class="op">-></span> <span class="ident">io</span>::<span class="prelude-ty">Result</span><span class="op"><</span>()<span class="op">></span> {
|
|||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">f</span> <span class="op">=</span> <span class="ident">File</span>::<span class="ident">open</span>(<span class="string">"foo.txt"</span>)<span class="question-mark">?</span>;
|
|||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">buffer</span> <span class="op">=</span> <span class="ident">String</span>::<span class="ident">new</span>();
|
|||
|
|
|||
|
<span class="ident">f</span>.<span class="ident">read_to_string</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">buffer</span>)<span class="question-mark">?</span>;
|
|||
|
<span class="prelude-val">Ok</span>(())
|
|||
|
}</pre>
|
|||
|
</div><h3 id='method.read_exact' class='method'><span id='read_exact.v' class='invisible'><code>fn <a href='#method.read_exact' class='fnname'>read_exact</a>(&mut self, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="../../tokio/io/struct.Error.html" title="struct tokio::io::Error">Error</a>></code><div class='since' title='Stable since Rust version 1.6.0'>1.6.0</div></span></h3><div class='docblock'><p>Read the exact number of bytes required to fill <code>buf</code>.</p>
|
|||
|
<p>This function reads as many bytes as necessary to completely fill the
|
|||
|
specified buffer <code>buf</code>.</p>
|
|||
|
<p>No guarantees are provided about the contents of <code>buf</code> when this
|
|||
|
function is called, implementations cannot rely on any property of the
|
|||
|
contents of <code>buf</code> being true. It is recommended that implementations
|
|||
|
only write data to <code>buf</code> instead of reading its contents.</p>
|
|||
|
<h1 id="errors-3" class="section-header"><a href="#errors-3">Errors</a></h1>
|
|||
|
<p>If this function encounters an error of the kind
|
|||
|
<a href="../../std/io/enum.ErrorKind.html#variant.Interrupted"><code>ErrorKind::Interrupted</code></a> then the error is ignored and the operation
|
|||
|
will continue.</p>
|
|||
|
<p>If this function encounters an "end of file" before completely filling
|
|||
|
the buffer, it returns an error of the kind <a href="../../std/io/enum.ErrorKind.html#variant.UnexpectedEof"><code>ErrorKind::UnexpectedEof</code></a>.
|
|||
|
The contents of <code>buf</code> are unspecified in this case.</p>
|
|||
|
<p>If any other read error is encountered then this function immediately
|
|||
|
returns. The contents of <code>buf</code> are unspecified in this case.</p>
|
|||
|
<p>If this function returns an error, it is unspecified how many bytes it
|
|||
|
has read, but it will never read more than would be necessary to
|
|||
|
completely fill the buffer.</p>
|
|||
|
<h1 id="examples-4" class="section-header"><a href="#examples-4">Examples</a></h1>
|
|||
|
<p><a href="../fs/struct.File.html"><code>File</code></a>s implement <code>Read</code>:</p>
|
|||
|
|
|||
|
<pre class="rust rust-example-rendered">
|
|||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">io</span>;
|
|||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">io</span>::<span class="ident">prelude</span>::<span class="kw-2">*</span>;
|
|||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fs</span>::<span class="ident">File</span>;
|
|||
|
|
|||
|
<span class="kw">fn</span> <span class="ident">main</span>() <span class="op">-></span> <span class="ident">io</span>::<span class="prelude-ty">Result</span><span class="op"><</span>()<span class="op">></span> {
|
|||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">f</span> <span class="op">=</span> <span class="ident">File</span>::<span class="ident">open</span>(<span class="string">"foo.txt"</span>)<span class="question-mark">?</span>;
|
|||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">buffer</span> <span class="op">=</span> [<span class="number">0</span>; <span class="number">10</span>];
|
|||
|
|
|||
|
<span class="comment">// read exactly 10 bytes</span>
|
|||
|
<span class="ident">f</span>.<span class="ident">read_exact</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">buffer</span>)<span class="question-mark">?</span>;
|
|||
|
<span class="prelude-val">Ok</span>(())
|
|||
|
}</pre>
|
|||
|
</div><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'a mut </a>R</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'a mut </a>R</h3><code class="content"><span class="where fmt-newline">impl<'a, R> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'a mut </a>R <span class="where fmt-newline">where<br> R: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></span><span class="where fmt-newline">impl<'a, W> <a class="trait" href="../../tokio/prelude/trait.Write.html" title="trait tokio::prelude::Write">Write</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'a mut </a>W <span class="where fmt-newline">where<br> W: <a class="trait" href="../../tokio/prelude/trait.Write.html" title="trait tokio::prelude::Write">Write</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></span><span class="where fmt-newline">impl<'a, I> <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'a mut </a>I <span class="where fmt-newline">where<br> I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></span><span class="where fmt-newline"> type <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = <I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::iterator::Iterator::Item">Item</a>;</span></code></div></div><h3 id='method.by_ref' class='method'><span id='by_ref.v' class='invisible'><code>fn <a href='#method.by_ref' class='fnname'>by_ref</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>Self</code></span></h3><div class='docblock'><p>Creates a "by reference" adaptor for this instance of <code>Read</code>.</p>
|
|||
|
<p>The returned adaptor also implements <code>Read</code> and will simply borrow this
|
|||
|
current reader.</p>
|
|||
|
<h1 id="examples-5" class="section-header"><a href="#examples-5">Examples</a></h1>
|
|||
|
<p><a href="../fs/struct.File.html"><code>File</code></a>s implement <code>Read</code>:</p>
|
|||
|
|
|||
|
<pre class="rust rust-example-rendered">
|
|||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">io</span>;
|
|||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">io</span>::<span class="ident">Read</span>;
|
|||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fs</span>::<span class="ident">File</span>;
|
|||
|
|
|||
|
<span class="kw">fn</span> <span class="ident">main</span>() <span class="op">-></span> <span class="ident">io</span>::<span class="prelude-ty">Result</span><span class="op"><</span>()<span class="op">></span> {
|
|||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">f</span> <span class="op">=</span> <span class="ident">File</span>::<span class="ident">open</span>(<span class="string">"foo.txt"</span>)<span class="question-mark">?</span>;
|
|||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">buffer</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">new</span>();
|
|||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">other_buffer</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">new</span>();
|
|||
|
|
|||
|
{
|
|||
|
<span class="kw">let</span> <span class="ident">reference</span> <span class="op">=</span> <span class="ident">f</span>.<span class="ident">by_ref</span>();
|
|||
|
|
|||
|
<span class="comment">// read at most 5 bytes</span>
|
|||
|
<span class="ident">reference</span>.<span class="ident">take</span>(<span class="number">5</span>).<span class="ident">read_to_end</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">buffer</span>)<span class="question-mark">?</span>;
|
|||
|
|
|||
|
} <span class="comment">// drop our &mut reference so we can use f again</span>
|
|||
|
|
|||
|
<span class="comment">// original file still usable, read the rest</span>
|
|||
|
<span class="ident">f</span>.<span class="ident">read_to_end</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">other_buffer</span>)<span class="question-mark">?</span>;
|
|||
|
<span class="prelude-val">Ok</span>(())
|
|||
|
}</pre>
|
|||
|
</div><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Bytes.html" title="struct std::io::Bytes">Bytes</a><R></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Bytes.html" title="struct std::io::Bytes">Bytes</a><R></h3><code class="content"><span class="where fmt-newline">impl<R> <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Bytes.html" title="struct std::io::Bytes">Bytes</a><R> <span class="where fmt-newline">where<br> R: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span><span class="where fmt-newline"> type <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>, <a class="struct" href="../../tokio/io/struct.Error.html" title="struct tokio::io::Error">Error</a>>;</span></code></div></div><h3 id='method.bytes' class='method'><span id='bytes.v' class='invisible'><code>fn <a href='#method.bytes' class='fnname'>bytes</a>(self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Bytes.html" title="struct std::io::Bytes">Bytes</a><Self></code></span></h3><div class='docblock'><p>Transforms this <code>Read</code> instance to an <a href="../../std/iter/trait.Iterator.html"><code>Iterator</code></a> over its bytes.</p>
|
|||
|
<p>The returned type implements <a href="../../std/iter/trait.Iterator.html"><code>Iterator</code></a> where the <code>Item</code> is
|
|||
|
<a href="../../std/result/enum.Result.html"><code>Result</code></a><code><</code><a href="../../std/primitive.u8.html"><code>u8</code></a><code>,</code><a href="../../std/io/struct.Error.html"><code>io::Error</code></a><code>></code>.
|
|||
|
The yielded item is <a href="../../std/result/enum.Result.html#variant.Ok"><code>Ok</code></a> if a byte was successfully read and <a href="../../std/result/enum.Result.html#variant.Err"><code>Err</code></a>
|
|||
|
otherwise. EOF is mapped to returning <a href="../../std/option/enum.Option.html#variant.None"><code>None</code></a> from this iterator.</p>
|
|||
|
<h1 id="examples-6" class="section-header"><a href="#examples-6">Examples</a></h1>
|
|||
|
<p><a href="../fs/struct.File.html"><code>File</code></a>s implement <code>Read</code>:</p>
|
|||
|
|
|||
|
<pre class="rust rust-example-rendered">
|
|||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">io</span>;
|
|||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">io</span>::<span class="ident">prelude</span>::<span class="kw-2">*</span>;
|
|||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fs</span>::<span class="ident">File</span>;
|
|||
|
|
|||
|
<span class="kw">fn</span> <span class="ident">main</span>() <span class="op">-></span> <span class="ident">io</span>::<span class="prelude-ty">Result</span><span class="op"><</span>()<span class="op">></span> {
|
|||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">f</span> <span class="op">=</span> <span class="ident">File</span>::<span class="ident">open</span>(<span class="string">"foo.txt"</span>)<span class="question-mark">?</span>;
|
|||
|
|
|||
|
<span class="kw">for</span> <span class="ident">byte</span> <span class="kw">in</span> <span class="ident">f</span>.<span class="ident">bytes</span>() {
|
|||
|
<span class="macro">println</span><span class="macro">!</span>(<span class="string">"{}"</span>, <span class="ident">byte</span>.<span class="ident">unwrap</span>());
|
|||
|
}
|
|||
|
<span class="prelude-val">Ok</span>(())
|
|||
|
}</pre>
|
|||
|
</div><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chars.html" title="struct std::io::Chars">Chars</a><R></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chars.html" title="struct std::io::Chars">Chars</a><R></h3><code class="content"><span class="where fmt-newline">impl<R> <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chars.html" title="struct std::io::Chars">Chars</a><R> <span class="where fmt-newline">where<br> R: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span><span class="where fmt-newline"> type <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.char.html">char</a>, <a class="enum" href="https://doc.rust-lang.org/nightly/std/io/enum.CharsError.html" title="enum std::io::CharsError">CharsError</a>>;</span></code></div></div><h3 id='method.chars' class='method'><span id='chars.v' class='invisible'><code>fn <a href='#method.chars' class='fnname'>chars</a>(self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chars.html" title="struct std::io::Chars">Chars</a><Self></code></span></h3><div class='stability'><div class='stab unstable'><details><summary><span class=microscope>🔬</span> This is a nightly-only experimental API. (<code>io</code>)</summary><p>the semantics of a partial read/write of where errors happen is currently unclear and may change</p>
|
|||
|
</details></div></div><div class='docblock'><p>Transforms this <code>Read</code> instance to an <a href="../../std/iter/trait.Iterator.html"><code>Iterator</code></a> over <a href="../../std/primitive.char.html"><code>char</code></a>s.</p>
|
|||
|
<p>This adaptor will attempt to interpret this reader as a UTF-8 encoded
|
|||
|
sequence of characters. The returned iterator will return <a href="../../std/option/enum.Option.html#variant.None"><code>None</code></a> once
|
|||
|
EOF is reached for this reader. Otherwise each element yielded will be a
|
|||
|
<a href="../../std/result/enum.Result.html"><code>Result</code></a><code><</code><a href="../../std/primitive.char.html"><code>char</code></a><code>, E></code> where <code>E</code> may contain information about what I/O error
|
|||
|
occurred or where decoding failed.</p>
|
|||
|
<p>Currently this adaptor will discard intermediate data read, and should
|
|||
|
be avoided if this is not desired.</p>
|
|||
|
<h1 id="examples-7" class="section-header"><a href="#examples-7">Examples</a></h1>
|
|||
|
<p><a href="../fs/struct.File.html"><code>File</code></a>s implement <code>Read</code>:</p>
|
|||
|
|
|||
|
<pre class="rust rust-example-rendered">
|
|||
|
<span class="attribute">#![<span class="ident">feature</span>(<span class="ident">io</span>)]</span>
|
|||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">io</span>;
|
|||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">io</span>::<span class="ident">prelude</span>::<span class="kw-2">*</span>;
|
|||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fs</span>::<span class="ident">File</span>;
|
|||
|
|
|||
|
<span class="kw">fn</span> <span class="ident">main</span>() <span class="op">-></span> <span class="ident">io</span>::<span class="prelude-ty">Result</span><span class="op"><</span>()<span class="op">></span> {
|
|||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">f</span> <span class="op">=</span> <span class="ident">File</span>::<span class="ident">open</span>(<span class="string">"foo.txt"</span>)<span class="question-mark">?</span>;
|
|||
|
|
|||
|
<span class="kw">for</span> <span class="ident">c</span> <span class="kw">in</span> <span class="ident">f</span>.<span class="ident">chars</span>() {
|
|||
|
<span class="macro">println</span><span class="macro">!</span>(<span class="string">"{}"</span>, <span class="ident">c</span>.<span class="ident">unwrap</span>());
|
|||
|
}
|
|||
|
<span class="prelude-val">Ok</span>(())
|
|||
|
}</pre>
|
|||
|
</div><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></h3><code class="content"><span class="where fmt-newline">impl<T, U> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>,<br> U: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><h3 id='method.chain' class='method'><span id='chain.v' class='invisible'><code>fn <a href='#method.chain' class='fnname'>chain</a><R>(self, next: R) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><Self, R> <span class="where fmt-newline">where<br> R: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></code></span></h3><div class='docblock'><p>Creates an adaptor which will chain this stream with another.</p>
|
|||
|
<p>The returned <code>Read</code> instance will first read all bytes from this object
|
|||
|
until EOF is encountered. Afterwards the output is equivalent to the
|
|||
|
output of <code>next</code>.</p>
|
|||
|
<h1 id="examples-8" class="section-header"><a href="#examples-8">Examples</a></h1>
|
|||
|
<p><a href="../fs/struct.File.html"><code>File</code></a>s implement <code>Read</code>:</p>
|
|||
|
|
|||
|
<pre class="rust rust-example-rendered">
|
|||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">io</span>;
|
|||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">io</span>::<span class="ident">prelude</span>::<span class="kw-2">*</span>;
|
|||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fs</span>::<span class="ident">File</span>;
|
|||
|
|
|||
|
<span class="kw">fn</span> <span class="ident">main</span>() <span class="op">-></span> <span class="ident">io</span>::<span class="prelude-ty">Result</span><span class="op"><</span>()<span class="op">></span> {
|
|||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">f1</span> <span class="op">=</span> <span class="ident">File</span>::<span class="ident">open</span>(<span class="string">"foo.txt"</span>)<span class="question-mark">?</span>;
|
|||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">f2</span> <span class="op">=</span> <span class="ident">File</span>::<span class="ident">open</span>(<span class="string">"bar.txt"</span>)<span class="question-mark">?</span>;
|
|||
|
|
|||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">handle</span> <span class="op">=</span> <span class="ident">f1</span>.<span class="ident">chain</span>(<span class="ident">f2</span>);
|
|||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">buffer</span> <span class="op">=</span> <span class="ident">String</span>::<span class="ident">new</span>();
|
|||
|
|
|||
|
<span class="comment">// read the value into a String. We could use any Read method here,</span>
|
|||
|
<span class="comment">// this is just one example.</span>
|
|||
|
<span class="ident">handle</span>.<span class="ident">read_to_string</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">buffer</span>)<span class="question-mark">?</span>;
|
|||
|
<span class="prelude-val">Ok</span>(())
|
|||
|
}</pre>
|
|||
|
</div><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></h3><code class="content"><span class="where fmt-newline">impl<T> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><h3 id='method.take' class='method'><span id='take.v' class='invisible'><code>fn <a href='#method.take' class='fnname'>take</a>(self, limit: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><Self></code></span></h3><div class='docblock'><p>Creates an adaptor which will read at most <code>limit</code> bytes from it.</p>
|
|||
|
<p>This function returns a new instance of <code>Read</code> which will read at most
|
|||
|
<code>limit</code> bytes, after which it will always return EOF (<a href="../../std/result/enum.Result.html#variant.Ok"><code>Ok(0)</code></a>). Any
|
|||
|
read errors will not count towards the number of bytes read and future
|
|||
|
calls to <a href="trait.Read.html#tymethod.read"><code>read()</code></a> may succeed.</p>
|
|||
|
<h1 id="examples-9" class="section-header"><a href="#examples-9">Examples</a></h1>
|
|||
|
<p><a href="../fs/struct.File.html"><code>File</code></a>s implement <code>Read</code>:</p>
|
|||
|
|
|||
|
<pre class="rust rust-example-rendered">
|
|||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">io</span>;
|
|||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">io</span>::<span class="ident">prelude</span>::<span class="kw-2">*</span>;
|
|||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fs</span>::<span class="ident">File</span>;
|
|||
|
|
|||
|
<span class="kw">fn</span> <span class="ident">main</span>() <span class="op">-></span> <span class="ident">io</span>::<span class="prelude-ty">Result</span><span class="op"><</span>()<span class="op">></span> {
|
|||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">f</span> <span class="op">=</span> <span class="ident">File</span>::<span class="ident">open</span>(<span class="string">"foo.txt"</span>)<span class="question-mark">?</span>;
|
|||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">buffer</span> <span class="op">=</span> [<span class="number">0</span>; <span class="number">5</span>];
|
|||
|
|
|||
|
<span class="comment">// read at most five bytes</span>
|
|||
|
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">handle</span> <span class="op">=</span> <span class="ident">f</span>.<span class="ident">take</span>(<span class="number">5</span>);
|
|||
|
|
|||
|
<span class="ident">handle</span>.<span class="ident">read</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">buffer</span>)<span class="question-mark">?</span>;
|
|||
|
<span class="prelude-val">Ok</span>(())
|
|||
|
}</pre>
|
|||
|
</div></div>
|
|||
|
<h2 id='foreign-impls' class='small-section-header'>
|
|||
|
Implementations on Foreign Types<a href='#foreign-impls' class='anchor'></a>
|
|||
|
</h2>
|
|||
|
<h3 id='impl-Read' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<T> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></code><a href='#impl-Read' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#1924-1940' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><span class='docblock autohide'><div class='impl-items'><h4 id='method.read' class="method"><span id='read.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.read' class='fnname'>read</a>(&mut self, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="struct" href="../../tokio/io/struct.Error.html" title="struct tokio::io::Error">Error</a>></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#1925-1935' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.initializer-1' class="method"><span id='initializer.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>unsafe fn <a href='#method.initializer' class='fnname'>initializer</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Initializer.html" title="struct std::io::Initializer">Initializer</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#1937-1939' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='stability'><div class='stab unstable'><span class=microscope>🔬</span> This is a nightly-only experimental API. (<code>read_initializer</code>)</div></div><h4 id='method.read_to_end-1' class="method"><span id='read_to_end.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.read_to_end' class='fnname'>read_to_end</a>(&mut self, buf: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="struct" href="../../tokio/io/struct.Error.html" title="struct tokio::io::Error">Error</a>></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#599-601' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.read_to_string-1' class="method"><span id='read_to_string.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.read_to_string' class='fnname'>read_to_string</a>(&mut self, buf: &mut <a class="struct" hre
|
|||
|
</details></div></div><h4 id='method.chain-1' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></h3><code class="content"><span class="where fmt-newline">impl<T, U> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>,<br> U: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='chain.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.chain' class='fnname'>chain</a><R>(self, next: R) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><Self, R> <span class="where fmt-newline">where<br> R: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#868-870' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.take-1' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></h3><code class="content"><span class="where fmt-newline">impl<T> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='take.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.take' class='fnname'>take</a>(self, limit: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><Self></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#904-906' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div></span><h3 id='impl-Read-1' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<'a> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for &'a <a class="struct" href="https://doc.rust-lang.org/nightly/std/fs/struct.File.html" title="struct std::fs::File">File</a></code><a href='#impl-Read-1' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a
|
|||
|
</details></div></div><h4 id='method.chain-2' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></h3><code class="content"><span class="where fmt-newline">impl<T, U> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>,<br> U: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='chain.v-2' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.chain' class='fnname'>chain</a><R>(self, next: R) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><Self, R> <span class="where fmt-newline">where<br> R: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#868-870' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.take-2' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></h3><code class="content"><span class="where fmt-newline">impl<T> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='take.v-2' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.take' class='fnname'>take</a>(self, limit: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><Self></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#904-906' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div></span><h3 id='impl-Read-2' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<R> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><R> <span class="where fmt-newline">where<br> R: <a class="trait" href="../../tokio/prelude
|
|||
|
</details></div></div><h4 id='method.chain-3' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></h3><code class="content"><span class="where fmt-newline">impl<T, U> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>,<br> U: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='chain.v-3' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.chain' class='fnname'>chain</a><R>(self, next: R) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><Self, R> <span class="where fmt-newline">where<br> R: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#868-870' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.take-3' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></h3><code class="content"><span class="where fmt-newline">impl<T> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='take.v-3' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.take' class='fnname'>take</a>(self, limit: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><Self></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#904-906' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div></span><h3 id='impl-Read-3' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/process/struct.ChildStdout.html" title="struct std::process::ChildStdout">ChildStdout</a></code><a href='#impl-Read-3' class='anchor'></a></span></td><td><span class='out-of-band'><div class='gh
|
|||
|
</details></div></div><h4 id='method.chain-4' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></h3><code class="content"><span class="where fmt-newline">impl<T, U> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>,<br> U: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='chain.v-4' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.chain' class='fnname'>chain</a><R>(self, next: R) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><Self, R> <span class="where fmt-newline">where<br> R: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#868-870' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.take-4' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></h3><code class="content"><span class="where fmt-newline">impl<T> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='take.v-4' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.take' class='fnname'>take</a>(self, limit: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><Self></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#904-906' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div></span><h3 id='impl-Read-4' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<'a> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/stdio/struct.StdinLock.html" title="struct std::io::stdio::StdinLock">StdinLock</a><'a></code><a href='#impl-Read-4' class='anchor'></a></span></td><td><span class='out-of-ban
|
|||
|
</details></div></div><h4 id='method.chain-5' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></h3><code class="content"><span class="where fmt-newline">impl<T, U> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>,<br> U: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='chain.v-5' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.chain' class='fnname'>chain</a><R>(self, next: R) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><Self, R> <span class="where fmt-newline">where<br> R: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#868-870' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.take-5' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></h3><code class="content"><span class="where fmt-newline">impl<T> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='take.v-5' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.take' class='fnname'>take</a>(self, limit: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><Self></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#904-906' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div></span><h3 id='impl-Read-5' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/util/struct.Empty.html" title="struct std::io::util::Empty">Empty</a></code><a href='#impl-Read-5' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a cla
|
|||
|
</details></div></div><h4 id='method.chain-6' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></h3><code class="content"><span class="where fmt-newline">impl<T, U> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>,<br> U: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='chain.v-6' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.chain' class='fnname'>chain</a><R>(self, next: R) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><Self, R> <span class="where fmt-newline">where<br> R: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#868-870' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.take-6' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></h3><code class="content"><span class="where fmt-newline">impl<T> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='take.v-6' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.take' class='fnname'>take</a>(self, limit: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><Self></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#904-906' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div></span><h3 id='impl-Read-6' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/sys/unix/ext/net/struct.UnixStream.html" title="struct std::sys::unix::ext::net::UnixStream">UnixStream</a></code><a href='#impl-Read-6' class='anchor'></a></span></td><td><span class='out-of-ba
|
|||
|
</details></div></div><h4 id='method.chain-7' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></h3><code class="content"><span class="where fmt-newline">impl<T, U> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>,<br> U: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='chain.v-7' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.chain' class='fnname'>chain</a><R>(self, next: R) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><Self, R> <span class="where fmt-newline">where<br> R: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#868-870' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.take-7' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></h3><code class="content"><span class="where fmt-newline">impl<T> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='take.v-7' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.take' class='fnname'>take</a>(self, limit: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><Self></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#904-906' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div></span><h3 id='impl-Read-7' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/net/tcp/struct.TcpStream.html" title="struct std::net:
|
|||
|
</details></div></div><h4 id='method.chain-8' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></h3><code class="content"><span class="where fmt-newline">impl<T, U> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>,<br> U: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='chain.v-8' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.chain' class='fnname'>chain</a><R>(self, next: R) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><Self, R> <span class="where fmt-newline">where<br> R: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#868-870' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.take-8' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></h3><code class="content"><span class="where fmt-newline">impl<T> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='take.v-8' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.take' class='fnname'>take</a>(self, limit: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><Self></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#904-906' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div></span><h3 id='impl-Read-8' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/fs/struct.File.html" title="struct std::fs::File">File</a></code><a href='#impl-Read-8' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' h
|
|||
|
</details></div></div><h4 id='method.chain-9' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></h3><code class="content"><span class="where fmt-newline">impl<T, U> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>,<br> U: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='chain.v-9' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.chain' class='fnname'>chain</a><R>(self, next: R) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><Self, R> <span class="where fmt-newline">where<br> R: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#868-870' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.take-9' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></h3><code class="content"><span class="where fmt-newline">impl<T> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='take.v-9' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.take' class='fnname'>take</a>(self, limit: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><Self></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#904-906' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div></span><h3 id='impl-Read-9' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/util/struct.Repeat.html" title="struct std::io::util::Repeat">Repeat</a></code><a href='#impl-Read-9' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a
|
|||
|
</details></div></div><h4 id='method.chain-10' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></h3><code class="content"><span class="where fmt-newline">impl<T, U> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>,<br> U: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='chain.v-10' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.chain' class='fnname'>chain</a><R>(self, next: R) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><Self, R> <span class="where fmt-newline">where<br> R: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#868-870' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.take-10' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></h3><code class="content"><span class="where fmt-newline">impl<T> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='take.v-10' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.take' class='fnname'>take</a>(self, limit: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><Self></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#904-906' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div></span><h3 id='impl-Read-10' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<'a> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for &'a <a class="struct" href="https://doc.rust-lang.org/nightly/std/net/tcp/struct.TcpStream.html" title="struct std::net::tcp::TcpStream">TcpStream</a></code><a href='#impl-Read-10' class='anchor'></a></span></td><td><span class='out-of-b
|
|||
|
</details></div></div><h4 id='method.chain-11' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></h3><code class="content"><span class="where fmt-newline">impl<T, U> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>,<br> U: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='chain.v-11' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.chain' class='fnname'>chain</a><R>(self, next: R) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><Self, R> <span class="where fmt-newline">where<br> R: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#868-870' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.take-11' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></h3><code class="content"><span class="where fmt-newline">impl<T> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='take.v-11' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.take' class='fnname'>take</a>(self, limit: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><Self></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#904-906' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div></span><h3 id='impl-Read-11' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<T, U> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/
|
|||
|
</details></div></div><h4 id='method.chain-12' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></h3><code class="content"><span class="where fmt-newline">impl<T, U> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>,<br> U: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='chain.v-12' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.chain' class='fnname'>chain</a><R>(self, next: R) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><Self, R> <span class="where fmt-newline">where<br> R: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#868-870' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.take-12' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></h3><code class="content"><span class="where fmt-newline">impl<T> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='take.v-12' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.take' class='fnname'>take</a>(self, limit: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><Self></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#904-906' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div></span><h3 id='impl-Read-12' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/process/struct.ChildStderr.html" title="struct std::process::ChildStderr">ChildStderr</a></code><a href='#impl-Read-12' class='anchor'></a></span></td><td><span class='out-of-band'><div cla
|
|||
|
</details></div></div><h4 id='method.chain-13' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></h3><code class="content"><span class="where fmt-newline">impl<T, U> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>,<br> U: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='chain.v-13' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.chain' class='fnname'>chain</a><R>(self, next: R) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><Self, R> <span class="where fmt-newline">where<br> R: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#868-870' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.take-13' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></h3><code class="content"><span class="where fmt-newline">impl<T> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='take.v-13' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.take' class='fnname'>take</a>(self, limit: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><Self></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#904-906' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div></span><h3 id='impl-Read-13' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<'a, R> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'a mut </a>R <span class="where fmt-newline">where<br> R: <a class="trait" href="../../tokio/prelude/trait.Read.html" t
|
|||
|
</details></div></div><h4 id='method.chain-14' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></h3><code class="content"><span class="where fmt-newline">impl<T, U> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>,<br> U: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='chain.v-14' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.chain' class='fnname'>chain</a><R>(self, next: R) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><Self, R> <span class="where fmt-newline">where<br> R: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#868-870' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.take-14' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></h3><code class="content"><span class="where fmt-newline">impl<T> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='take.v-14' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.take' class='fnname'>take</a>(self, limit: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><Self></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#904-906' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div></span><h3 id='impl-Read-14' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<'a> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for &'a <a class="struct" href="https://doc.rust-lang.org/nightly/std/sys/unix/ext/net/struct.UnixStream.html" title="struct std::sys::unix::ext::net::UnixStream">UnixStream</a></code><a href='#impl-Read-14' class='anchor'></a></span></td><t
|
|||
|
</details></div></div><h4 id='method.chain-15' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></h3><code class="content"><span class="where fmt-newline">impl<T, U> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>,<br> U: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='chain.v-15' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.chain' class='fnname'>chain</a><R>(self, next: R) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><Self, R> <span class="where fmt-newline">where<br> R: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#868-870' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.take-15' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></h3><code class="content"><span class="where fmt-newline">impl<T> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='take.v-15' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.take' class='fnname'>take</a>(self, limit: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><Self></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#904-906' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div></span><h3 id='impl-Read-15' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<'a> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&'a [</a><
|
|||
|
<p>Note that reading updates the slice to point to the yet unread part.
|
|||
|
The slice will be empty when EOF is reached.</p>
|
|||
|
</div><span class='docblock autohide'><div class='impl-items'><h4 id='method.read-15' class="method"><span id='read.v-16' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.read' class='fnname'>read</a>(&mut self, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="struct" href="../../tokio/io/struct.Error.html" title="struct tokio::io::Error">Error</a>></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/impls.rs.html#167-182' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.initializer-16' class="method"><span id='initializer.v-16' class='invisible'><table class='table-display'><tbody><tr><td><code>unsafe fn <a href='#method.initializer' class='fnname'>initializer</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Initializer.html" title="struct std::io::Initializer">Initializer</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/impls.rs.html#185-187' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='stability'><div class='stab unstable'><span class=microscope>🔬</span> This is a nightly-only experimental API. (<code>read_initializer</code>)</div></div><h4 id='method.read_exact-16' class="method"><span id='read_exact.v-16' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.read_exact' class='fnname'>read_exact</a>(&mut self, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="../../tokio/io/struct.Error.html" title="struct tokio::io::Error">Error</a>></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/impls.rs.html#190-208' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.read_to_end-16' class="method"><span id='read_to_end.v-16' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.read_to_end' class='fnname'>read_to_end</a>(&mut self, buf: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="struct" href="../../tokio/io/struct.Error.html" title="struct tokio::io::Error">Error</a>></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/impls.rs.html#211-216' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.read_to_string-16' class="method"><span id='read_to_st
|
|||
|
</details></div></div><h4 id='method.chain-16' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></h3><code class="content"><span class="where fmt-newline">impl<T, U> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>,<br> U: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='chain.v-16' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.chain' class='fnname'>chain</a><R>(self, next: R) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><Self, R> <span class="where fmt-newline">where<br> R: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#868-870' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.take-16' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></h3><code class="content"><span class="where fmt-newline">impl<T> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='take.v-16' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.take' class='fnname'>take</a>(self, limit: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><Self></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#904-906' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div></span><h3 id='impl-Read-16' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/stdio/struct.Stdin.html" title="struct std::io::stdio::Stdin">Stdin</a></code><a href='#impl-Read-16' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></di
|
|||
|
</details></div></div><h4 id='method.chain-17' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></h3><code class="content"><span class="where fmt-newline">impl<T, U> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>,<br> U: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='chain.v-17' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.chain' class='fnname'>chain</a><R>(self, next: R) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><Self, R> <span class="where fmt-newline">where<br> R: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#868-870' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.take-17' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></h3><code class="content"><span class="where fmt-newline">impl<T> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='take.v-17' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.take' class='fnname'>take</a>(self, limit: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><Self></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#904-906' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div></span><h3 id='impl-Read-17' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<T> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/cursor/struct.Cursor.html" title="struct std::io::cursor::Cursor">Cursor</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="
|
|||
|
</details></div></div><h4 id='method.chain-18' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></h3><code class="content"><span class="where fmt-newline">impl<T, U> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>,<br> U: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='chain.v-18' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.chain' class='fnname'>chain</a><R>(self, next: R) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><Self, R> <span class="where fmt-newline">where<br> R: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#868-870' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.take-18' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></h3><code class="content"><span class="where fmt-newline">impl<T> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='take.v-18' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.take' class='fnname'>take</a>(self, limit: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><Self></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#904-906' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div></span><h3 id='impl-Read-18' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<R> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/buffered/struct.BufReader.html" title="struct std::io::buffered::BufReader">BufReader</a><R> <span class="where fmt-newline">where<br> R: <a class="
|
|||
|
</details></div></div><h4 id='method.chain-19' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></h3><code class="content"><span class="where fmt-newline">impl<T, U> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>,<br> U: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='chain.v-19' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.chain' class='fnname'>chain</a><R>(self, next: R) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><Self, R> <span class="where fmt-newline">where<br> R: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#868-870' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.take-19' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></h3><code class="content"><span class="where fmt-newline">impl<T> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='take.v-19' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.take' class='fnname'>take</a>(self, limit: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><Self></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#904-906' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div></span><h3 id='impl-Read-19' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="../../mio/net/tcp/struct.TcpStream.html" title="struct mio::net::tcp::TcpStream">TcpStream</a></code><a href='#impl-Read-19' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclin
|
|||
|
</details></div></div><h4 id='method.chain-20' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></h3><code class="content"><span class="where fmt-newline">impl<T, U> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>,<br> U: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='chain.v-20' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.chain' class='fnname'>chain</a><R>(self, next: R) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><Self, R> <span class="where fmt-newline">where<br> R: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#868-870' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.take-20' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></h3><code class="content"><span class="where fmt-newline">impl<T> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='take.v-20' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.take' class='fnname'>take</a>(self, limit: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><Self></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#904-906' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div></span><h3 id='impl-Read-20' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<'a> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for &'a <a class="struct" href="../../mio/net/tcp/struct.TcpStream.html" title="struct mio::net::tcp:
|
|||
|
</details></div></div><h4 id='method.chain-21' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></h3><code class="content"><span class="where fmt-newline">impl<T, U> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>,<br> U: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='chain.v-21' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.chain' class='fnname'>chain</a><R>(self, next: R) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><Self, R> <span class="where fmt-newline">where<br> R: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#868-870' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.take-21' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></h3><code class="content"><span class="where fmt-newline">impl<T> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='take.v-21' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.take' class='fnname'>take</a>(self, limit: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><Self></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#904-906' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div></span><h3 id='impl-Read-21' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<T> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="../../tokio_io/allow_std/struct.AllowStdIo.html" title="struct tokio_io::allow
|
|||
|
</details></div></div><h4 id='method.chain-22' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></h3><code class="content"><span class="where fmt-newline">impl<T, U> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>,<br> U: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='chain.v-22' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.chain' class='fnname'>chain</a><R>(self, next: R) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><Self, R> <span class="where fmt-newline">where<br> R: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#868-870' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.take-22' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></h3><code class="content"><span class="where fmt-newline">impl<T> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='take.v-22' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.take' class='fnname'>take</a>(self, limit: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><Self></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#904-906' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div></span><h3 id='impl-Read-22' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<B> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="../../bytes/buf/reader/struct.Reader.html" title="struct bytes::buf::reader::R
|
|||
|
</details></div></div><h4 id='method.chain-23' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U></h3><code class="content"><span class="where fmt-newline">impl<T, U> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><T, U> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>,<br> U: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='chain.v-23' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.chain' class='fnname'>chain</a><R>(self, next: R) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><Self, R> <span class="where fmt-newline">where<br> R: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#868-870' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.take-23' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T></h3><code class="content"><span class="where fmt-newline">impl<T> <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></span></code></div></div><span id='take.v-23' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#method.take' class='fnname'>take</a>(self, limit: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/struct.Take.html" title="struct std::io::Take">Take</a><Self></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#904-906' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div></span>
|
|||
|
<h2 id='implementors' class='small-section-header'>
|
|||
|
Implementors<a href='#implementors' class='anchor'></a>
|
|||
|
</h2>
|
|||
|
<ul class='item-list' id='implementors-list'>
|
|||
|
<li><table class='table-display'><tbody><tr><td><code>impl<T> Read for <a class="struct" href="../../tokio/io/struct.ReadHalf.html" title="struct tokio::io::ReadHalf">ReadHalf</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="../../tokio/prelude/trait.AsyncRead.html" title="trait tokio::prelude::AsyncRead">AsyncRead</a>, </span></code><td><div class='out-of-band'><a class='srclink' href='../../src/tokio_io/split.rs.html#30-37' title='goto source code'>[src]</a></div></td></tr></tbody></table></li>
|
|||
|
<li><table class='table-display'><tbody><tr><td><code>impl Read for tokio::io::<a class="struct" href="../../tokio/io/struct.Stdin.html" title="struct tokio::io::Stdin">Stdin</a></code><td><div class='out-of-band'><a class='srclink' href='../../src/tokio_fs/stdin.rs.html#28-32' title='goto source code'>[src]</a></div></td></tr></tbody></table></li>
|
|||
|
<li><table class='table-display'><tbody><tr><td><code>impl Read for tokio::fs::<a class="struct" href="../../tokio/fs/struct.File.html" title="struct tokio::fs::File">File</a></code><td><div class='out-of-band'><a class='srclink' href='../../src/tokio_fs/file/mod.rs.html#184-188' title='goto source code'>[src]</a></div></td></tr></tbody></table></li>
|
|||
|
<li><table class='table-display'><tbody><tr><td><code>impl<'a, E> Read for &'a <a class="struct" href="../../tokio/reactor/struct.PollEvented2.html" title="struct tokio::reactor::PollEvented2">PollEvented</a><E> <span class="where fmt-newline">where<br> E: <a class="trait" href="../../mio/event_imp/trait.Evented.html" title="trait mio::event_imp::Evented">Evented</a>,<br> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'a </a>E: <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></code><td><div class='out-of-band'><a class='srclink' href='../../src/tokio_reactor/poll_evented.rs.html#516-532' title='goto source code'>[src]</a></div></td></tr></tbody></table></li>
|
|||
|
<li><table class='table-display'><tbody><tr><td><code>impl<E> Read for <a class="struct" href="../../tokio/reactor/struct.PollEvented2.html" title="struct tokio::reactor::PollEvented2">PollEvented</a><E> <span class="where fmt-newline">where<br> E: <a class="trait" href="../../mio/event_imp/trait.Evented.html" title="trait mio::event_imp::Evented">Evented</a> + <a class="trait" href="../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a>, </span></code><td><div class='out-of-band'><a class='srclink' href='../../src/tokio_reactor/poll_evented.rs.html#387-403' title='goto source code'>[src]</a></div></td></tr></tbody></table></li>
|
|||
|
<li><table class='table-display'><tbody><tr><td><code>impl Read for tokio::net::<a class="struct" href="../../tokio/net/struct.TcpStream.html" title="struct tokio::net::TcpStream">TcpStream</a></code><td><div class='out-of-band'><a class='srclink' href='../../src/tokio_tcp/stream.rs.html#382-386' title='goto source code'>[src]</a></div></td></tr></tbody></table></li>
|
|||
|
<li><table class='table-display'><tbody><tr><td><code>impl<'a> Read for &'a tokio::net::<a class="struct" href="../../tokio/net/struct.TcpStream.html" title="struct tokio::net::TcpStream">TcpStream</a></code><td><div class='out-of-band'><a class='srclink' href='../../src/tokio_tcp/stream.rs.html#461-465' title='goto source code'>[src]</a></div></td></tr></tbody></table></li>
|
|||
|
</ul><script type="text/javascript">window.inlined_types=new Set([]);</script><script type="text/javascript" async
|
|||
|
src="../../implementors/std/io/trait.Read.js">
|
|||
|
</script></section>
|
|||
|
<section id='search' class="content hidden"></section>
|
|||
|
|
|||
|
<section class="footer"></section>
|
|||
|
|
|||
|
<aside id="help" class="hidden">
|
|||
|
<div>
|
|||
|
<h1 class="hidden">Help</h1>
|
|||
|
|
|||
|
<div class="shortcuts">
|
|||
|
<h2>Keyboard Shortcuts</h2>
|
|||
|
|
|||
|
<dl>
|
|||
|
<dt><kbd>?</kbd></dt>
|
|||
|
<dd>Show this help dialog</dd>
|
|||
|
<dt><kbd>S</kbd></dt>
|
|||
|
<dd>Focus the search field</dd>
|
|||
|
<dt><kbd>↑</kbd></dt>
|
|||
|
<dd>Move up in search results</dd>
|
|||
|
<dt><kbd>↓</kbd></dt>
|
|||
|
<dd>Move down in search results</dd>
|
|||
|
<dt><kbd>↹</kbd></dt>
|
|||
|
<dd>Switch tab</dd>
|
|||
|
<dt><kbd>⏎</kbd></dt>
|
|||
|
<dd>Go to active search result</dd>
|
|||
|
<dt><kbd>+</kbd></dt>
|
|||
|
<dd>Expand all sections</dd>
|
|||
|
<dt><kbd>-</kbd></dt>
|
|||
|
<dd>Collapse all sections</dd>
|
|||
|
</dl>
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="infos">
|
|||
|
<h2>Search Tricks</h2>
|
|||
|
|
|||
|
<p>
|
|||
|
Prefix searches with a type followed by a colon (e.g.
|
|||
|
<code>fn:</code>) to restrict the search to a given type.
|
|||
|
</p>
|
|||
|
|
|||
|
<p>
|
|||
|
Accepted types are: <code>fn</code>, <code>mod</code>,
|
|||
|
<code>struct</code>, <code>enum</code>,
|
|||
|
<code>trait</code>, <code>type</code>, <code>macro</code>,
|
|||
|
and <code>const</code>.
|
|||
|
</p>
|
|||
|
|
|||
|
<p>
|
|||
|
Search functions by type signature (e.g.
|
|||
|
<code>vec -> usize</code> or <code>* -> vec</code>)
|
|||
|
</p>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</aside>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<script>
|
|||
|
window.rootPath = "../../";
|
|||
|
window.currentCrate = "tokio";
|
|||
|
</script>
|
|||
|
<script src="../../main.js"></script>
|
|||
|
<script defer src="../../search-index.js"></script>
|
|||
|
</body>
|
|||
|
</html>
|