228 lines
No EOL
67 KiB
HTML
228 lines
No EOL
67 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 `File` struct in crate `tokio`.">
|
||
<meta name="keywords" content="rust, rustlang, rust-lang, File">
|
||
|
||
<title>tokio::fs::File - 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 struct">
|
||
<!--[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'>Struct File</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.open">open</a><a href="#method.create">create</a><a href="#method.poll_seek">poll_seek</a><a href="#method.poll_sync_all">poll_sync_all</a><a href="#method.poll_sync_data">poll_sync_data</a><a href="#method.poll_set_len">poll_set_len</a><a href="#method.poll_metadata">poll_metadata</a><a href="#method.poll_try_clone">poll_try_clone</a><a href="#method.poll_set_permissions">poll_set_permissions</a><a href="#method.into_std">into_std</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Read">Read</a><a href="#impl-Write">Write</a><a href="#impl-Debug">Debug</a><a href="#impl-Drop">Drop</a><a href="#impl-AsyncRead">AsyncRead</a><a href="#impl-AsyncWrite">AsyncWrite</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a></div></div><p class='location'><a href='../index.html'>tokio</a>::<wbr><a href='index.html'>fs</a></p><script>window.sidebarCurrent = {name: 'File', ty: 'struct', 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'>Struct <a href='../index.html'>tokio</a>::<wbr><a href='index.html'>fs</a>::<wbr><a class="struct" href=''>File</a></span><span class='out-of-band'><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='../../src/tokio_fs/file/mod.rs.html#34-36' title='goto source code'>[src]</a></span></h1><div class="docblock type-decl"><pre class='rust struct'>pub struct File { /* fields omitted */ }</pre></div><div class='docblock'><p>A reference to an open file on the filesystem.</p>
|
||
<p>This is a specialized version of <a href="https://doc.rust-lang.org/std/fs/struct.File.html"><code>std::fs::File</code></a> for usage from the
|
||
Tokio runtime.</p>
|
||
<p>An instance of a <code>File</code> can be read and/or written depending on what options
|
||
it was opened with. Files also implement Seek to alter the logical cursor
|
||
that the file contains internally.</p>
|
||
<p>Files are automatically closed when they go out of scope.</p>
|
||
</div>
|
||
<h2 id='methods' class='small-section-header'>
|
||
Methods<a href='#methods' class='anchor'></a>
|
||
</h2>
|
||
<h3 id='impl' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="struct" href="../../tokio/fs/struct.File.html" title="struct tokio::fs::File">File</a></code><a href='#impl' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/tokio_fs/file/mod.rs.html#38-182' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.open' class="method"><span id='open.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.open' class='fnname'>open</a><P>(path: P) -> <a class="struct" href="../../tokio/fs/file/struct.OpenFuture.html" title="struct tokio::fs::file::OpenFuture">OpenFuture</a><P> <span class="where fmt-newline">where<br> P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/path/struct.Path.html" title="struct std::path::Path">Path</a>> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'static, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/tokio_fs/file/mod.rs.html#51-55' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Attempts to open a file in read-only mode.</p>
|
||
<p>See <a href="struct.OpenOptions.html"><code>OpenOptions</code></a> for more details.</p>
|
||
<h1 id="errors" class="section-header"><a href="#errors">Errors</a></h1>
|
||
<p><code>OpenFuture</code> results in an error if called from outside of the Tokio
|
||
runtime or if the underlying <a href="https://doc.rust-lang.org/std/fs/struct.File.html#method.open"><code>open</code></a> call results in an error.</p>
|
||
</div><h4 id='method.create' class="method"><span id='create.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.create' class='fnname'>create</a><P>(path: P) -> <a class="struct" href="../../tokio/fs/file/struct.CreateFuture.html" title="struct tokio::fs::file::CreateFuture">CreateFuture</a><P> <span class="where fmt-newline">where<br> P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/path/struct.Path.html" title="struct std::path::Path">Path</a>> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'static, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/tokio_fs/file/mod.rs.html#72-76' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Opens a file in write-only mode.</p>
|
||
<p>This function will create a file if it does not exist, and will truncate
|
||
it if it does.</p>
|
||
<p>See <a href="struct.OpenOptions.html"><code>OpenOptions</code></a> for more details.</p>
|
||
<h1 id="errors-1" class="section-header"><a href="#errors-1">Errors</a></h1>
|
||
<p><code>CreateFuture</code> results in an error if called from outside of the Tokio
|
||
runtime or if the underlying <a href="https://doc.rust-lang.org/std/fs/struct.File.html#method.create"><code>create</code></a> call results in an error.</p>
|
||
</div><h4 id='method.poll_seek' class="method"><span id='poll_seek.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.poll_seek' class='fnname'>poll_seek</a>(&mut self, pos: <a class="enum" href="https://doc.rust-lang.org/nightly/std/io/enum.SeekFrom.html" title="enum std::io::SeekFrom">SeekFrom</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="enum" href="../../tokio/prelude/enum.Async.html" title="enum tokio::prelude::Async">Async</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</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='../../src/tokio_fs/file/mod.rs.html#97-99' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Seek to an offset, in bytes, in a stream.</p>
|
||
<p>A seek beyond the end of a stream is allowed, but implementation
|
||
defined.</p>
|
||
<p>If the seek operation completed successfully, this method returns the
|
||
new position from the start of the stream. That position can be used
|
||
later with <code>SeekFrom::Start</code>.</p>
|
||
<h1 id="errors-2" class="section-header"><a href="#errors-2">Errors</a></h1>
|
||
<p>Seeking to a negative offset is considered an error.</p>
|
||
</div><h4 id='method.poll_sync_all' class="method"><span id='poll_sync_all.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.poll_sync_all' class='fnname'>poll_sync_all</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="../../tokio/prelude/enum.Async.html" title="enum tokio::prelude::Async">Async</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='../../src/tokio_fs/file/mod.rs.html#105-107' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Attempts to sync all OS-internal metadata to disk.</p>
|
||
<p>This function will attempt to ensure that all in-core data reaches the
|
||
filesystem before returning.</p>
|
||
</div><h4 id='method.poll_sync_data' class="method"><span id='poll_sync_data.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.poll_sync_data' class='fnname'>poll_sync_data</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="../../tokio/prelude/enum.Async.html" title="enum tokio::prelude::Async">Async</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='../../src/tokio_fs/file/mod.rs.html#117-119' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>This function is similar to <code>poll_sync_all</code>, except that it may not
|
||
synchronize file metadata to the filesystem.</p>
|
||
<p>This is intended for use cases that must synchronize content, but don't
|
||
need the metadata on disk. The goal of this method is to reduce disk
|
||
operations.</p>
|
||
<p>Note that some platforms may simply implement this in terms of <code>poll_sync_all</code>.</p>
|
||
</div><h4 id='method.poll_set_len' class="method"><span id='poll_set_len.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.poll_set_len' class='fnname'>poll_set_len</a>(&mut self, size: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</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="enum" href="../../tokio/prelude/enum.Async.html" title="enum tokio::prelude::Async">Async</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='../../src/tokio_fs/file/mod.rs.html#132-134' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Truncates or extends the underlying file, updating the size of this file to become size.</p>
|
||
<p>If the size is less than the current file's size, then the file will be
|
||
shrunk. If it is greater than the current file's size, then the file
|
||
will be extended to size and have all of the intermediate data filled in
|
||
with 0s.</p>
|
||
<h1 id="errors-3" class="section-header"><a href="#errors-3">Errors</a></h1>
|
||
<p>This function will return an error if the file is not opened for
|
||
writing.</p>
|
||
</div><h4 id='method.poll_metadata' class="method"><span id='poll_metadata.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.poll_metadata' class='fnname'>poll_metadata</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="../../tokio/prelude/enum.Async.html" title="enum tokio::prelude::Async">Async</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/fs/struct.Metadata.html" title="struct std::fs::Metadata">Metadata</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='../../src/tokio_fs/file/mod.rs.html#137-139' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Queries metadata about the underlying file.</p>
|
||
</div><h4 id='method.poll_try_clone' class="method"><span id='poll_try_clone.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.poll_try_clone' class='fnname'>poll_try_clone</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="../../tokio/prelude/enum.Async.html" title="enum tokio::prelude::Async">Async</a><<a class="struct" href="../../tokio/fs/struct.File.html" title="struct tokio::fs::File">File</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='../../src/tokio_fs/file/mod.rs.html#144-149' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Create a new <code>File</code> instance that shares the same underlying file handle
|
||
as the existing <code>File</code> instance. Reads, writes, and seeks will affect both
|
||
File instances simultaneously.</p>
|
||
</div><h4 id='method.poll_set_permissions' class="method"><span id='poll_set_permissions.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.poll_set_permissions' class='fnname'>poll_set_permissions</a>(<br> &mut self, <br> perm: <a class="struct" href="https://doc.rust-lang.org/nightly/std/fs/struct.Permissions.html" title="struct std::fs::Permissions">Permissions</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="../../tokio/prelude/enum.Async.html" title="enum tokio::prelude::Async">Async</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='../../src/tokio_fs/file/mod.rs.html#166-168' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Changes the permissions on the underlying file.</p>
|
||
<h1 id="platform-specific-behavior" class="section-header"><a href="#platform-specific-behavior">Platform-specific behavior</a></h1>
|
||
<p>This function currently corresponds to the <code>fchmod</code> function on Unix and
|
||
the <code>SetFileInformationByHandle</code> function on Windows. Note that, this
|
||
<a href="https://doc.rust-lang.org/std/io/index.html#platform-specific-behavior">may change in the future</a>.</p>
|
||
<h1 id="errors-4" class="section-header"><a href="#errors-4">Errors</a></h1>
|
||
<p>This function will return an error if the user lacks permission change
|
||
attributes on the underlying file. It may also return an error in other
|
||
os-specific unspecified cases.</p>
|
||
</div><h4 id='method.into_std' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for &'a <a class="struct" href="https://doc.rust-lang.org/nightly/std/fs/struct.File.html" title="struct std::fs::File">File</a></span></div><div class="content hidden"><h3 class="important">Important traits for &'a <a class="struct" href="https://doc.rust-lang.org/nightly/std/fs/struct.File.html" title="struct std::fs::File">File</a></h3><code class="content"><span class="where fmt-newline">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></span><span class="where fmt-newline">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></span><span class="where fmt-newline">impl<'a> <a class="trait" href="../../tokio/prelude/trait.Write.html" title="trait tokio::prelude::Write">Write</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></span><span class="where fmt-newline">impl <a class="trait" href="../../tokio/prelude/trait.Write.html" title="trait tokio::prelude::Write">Write</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/fs/struct.File.html" title="struct std::fs::File">File</a></span></code></div></div><span id='into_std.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.into_std' class='fnname'>into_std</a>(self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/fs/struct.File.html" title="struct std::fs::File">File</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/tokio_fs/file/mod.rs.html#175-177' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Destructures the <code>tokio_fs::File</code> into a [<code>std::fs::File</code>][std].</p>
|
||
<h1 id="panics" class="section-header"><a href="#panics">Panics</a></h1>
|
||
<p>This function will panic if [<code>shutdown</code>] has been called.</p>
|
||
</div></div>
|
||
<h2 id='implementations' class='small-section-header'>
|
||
Trait Implementations<a href='#implementations' class='anchor'></a>
|
||
</h2>
|
||
<div id='implementations-list'>
|
||
<h3 id='impl-Read' 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="../../tokio/fs/struct.File.html" title="struct tokio::fs::File">File</a></code><a href='#impl-Read' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/tokio_fs/file/mod.rs.html#184-188' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.read' class="method"><span id='read.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#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></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/tokio_fs/file/mod.rs.html#185-187' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Pull some bytes from this source into the specified buffer, returning how many bytes were read. <a href="../../tokio/prelude/trait.Read.html#tymethod.read">Read more</a></p>
|
||
</div><h4 id='method.initializer' class="method"><span id='initializer.v' class='invisible'><table class='table-display'><tbody><tr><td><code>unsafe fn <a href='../../tokio/prelude/trait.Read.html#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#552-554' 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><div class='docblock'><p>Determines if this <code>Read</code>er can work with buffers of uninitialized memory. <a href="../../tokio/prelude/trait.Read.html#method.initializer">Read more</a></p>
|
||
</div><h4 id='method.read_to_end' class="method"><span id='read_to_end.v' 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><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#599-601' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Read all bytes until EOF in this source, placing them into <code>buf</code>. <a href="../../tokio/prelude/trait.Read.html#method.read_to_end">Read more</a></p>
|
||
</div><h4 id='method.read_to_string' class="method"><span id='read_to_string.v' 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" 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></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#637-648' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Read all bytes until EOF in this source, appending them to <code>buf</code>. <a href="../../tokio/prelude/trait.Read.html#method.read_to_string">Read more</a></p>
|
||
</div><h4 id='method.read_exact' class="method"><span id='read_exact.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#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><div class='since' title='Stable since Rust version 1.6.0'>1.6.0</div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/io/mod.rs.html#700-715' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Read the exact number of bytes required to fill <code>buf</code>. <a href="../../tokio/prelude/trait.Read.html#method.read_exact">Read more</a></p>
|
||
</div><h4 id='method.by_ref' class="method"><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><span id='by_ref.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#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></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#752' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Creates a "by reference" adaptor for this instance of <code>Read</code>. <a href="../../tokio/prelude/trait.Read.html#method.by_ref">Read more</a></p>
|
||
</div><h4 id='method.bytes' 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.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><span id='bytes.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#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></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#789-791' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Transforms this <code>Read</code> instance to an [<code>Iterator</code>] over its bytes. <a href="../../tokio/prelude/trait.Read.html#method.bytes">Read more</a></p>
|
||
</div><h4 id='method.chars' 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.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><span id='chars.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Read.html#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></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#833-835' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><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 [<code>Iterator</code>] over [<code>char</code>]s. <a href="../../tokio/prelude/trait.Read.html#method.chars">Read more</a></p>
|
||
</div><h4 id='method.chain' 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' 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><div class='docblock'><p>Creates an adaptor which will chain this stream with another. <a href="../../tokio/prelude/trait.Read.html#method.chain">Read more</a></p>
|
||
</div><h4 id='method.take' 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' 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 class='docblock'><p>Creates an adaptor which will read at most <code>limit</code> bytes from it. <a href="../../tokio/prelude/trait.Read.html#method.take">Read more</a></p>
|
||
</div></div><h3 id='impl-Write' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../../tokio/prelude/trait.Write.html" title="trait tokio::prelude::Write">Write</a> for <a class="struct" href="../../tokio/fs/struct.File.html" title="struct tokio::fs::File">File</a></code><a href='#impl-Write' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/tokio_fs/file/mod.rs.html#196-204' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.write' class="method"><span id='write.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Write.html#tymethod.write' class='fnname'>write</a>(&mut self, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</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='../../src/tokio_fs/file/mod.rs.html#197-199' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Write a buffer into this object, returning how many bytes were written. <a href="../../tokio/prelude/trait.Write.html#tymethod.write">Read more</a></p>
|
||
</div><h4 id='method.flush' class="method"><span id='flush.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Write.html#tymethod.flush' class='fnname'>flush</a>(&mut self) -> <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='../../src/tokio_fs/file/mod.rs.html#201-203' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Flush this output stream, ensuring that all intermediately buffered contents reach their destination. <a href="../../tokio/prelude/trait.Write.html#tymethod.flush">Read more</a></p>
|
||
</div><h4 id='method.write_all' class="method"><span id='write_all.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Write.html#method.write_all' class='fnname'>write_all</a>(&mut self, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</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><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#1096-1107' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Attempts to write an entire buffer into this write. <a href="../../tokio/prelude/trait.Write.html#method.write_all">Read more</a></p>
|
||
</div><h4 id='method.write_fmt' class="method"><span id='write_fmt.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Write.html#method.write_fmt' class='fnname'>write_fmt</a>(&mut self, fmt: <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Arguments.html" title="struct core::fmt::Arguments">Arguments</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><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#1148-1180' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Writes a formatted string into this writer, returning any error encountered. <a href="../../tokio/prelude/trait.Write.html#method.write_fmt">Read more</a></p>
|
||
</div><h4 id='method.by_ref-1' class="method"><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><span id='by_ref.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.Write.html#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></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#1204' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Creates a "by reference" adaptor for this instance of <code>Write</code>. <a href="../../tokio/prelude/trait.Write.html#method.by_ref">Read more</a></p>
|
||
</div></div><h3 id='impl-Debug' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../tokio/fs/struct.File.html" title="struct tokio::fs::File">File</a></code><a href='#impl-Debug' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/tokio_fs/file/mod.rs.html#33' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.fmt' class="method"><span id='fmt.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, __arg_0: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</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="https://doc.rust-lang.org/nightly/core/fmt/struct.Error.html" title="struct core::fmt::Error">Error</a>></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/tokio_fs/file/mod.rs.html#33' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
|
||
</div></div><h3 id='impl-Drop' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html" title="trait core::ops::drop::Drop">Drop</a> for <a class="struct" href="../../tokio/fs/struct.File.html" title="struct tokio::fs::File">File</a></code><a href='#impl-Drop' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/tokio_fs/file/mod.rs.html#215-222' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.drop' class="method"><span id='drop.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop' class='fnname'>drop</a>(&mut self)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/tokio_fs/file/mod.rs.html#216-221' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Executes the destructor for this type. <a href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop">Read more</a></p>
|
||
</div></div><h3 id='impl-AsyncRead' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../../tokio/prelude/trait.AsyncRead.html" title="trait tokio::prelude::AsyncRead">AsyncRead</a> for <a class="struct" href="../../tokio/fs/struct.File.html" title="struct tokio::fs::File">File</a></code><a href='#impl-AsyncRead' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/tokio_fs/file/mod.rs.html#190-194' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.prepare_uninitialized_buffer' class="method"><span id='prepare_uninitialized_buffer.v' class='invisible'><table class='table-display'><tbody><tr><td><code>unsafe fn <a href='../../tokio/prelude/trait.AsyncRead.html#method.prepare_uninitialized_buffer' class='fnname'>prepare_uninitialized_buffer</a>(&self, <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="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/tokio_fs/file/mod.rs.html#191-193' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Prepares an uninitialized buffer to be safe to pass to <code>read</code>. Returns <code>true</code> if the supplied buffer was zeroed out. <a href="../../tokio/prelude/trait.AsyncRead.html#method.prepare_uninitialized_buffer">Read more</a></p>
|
||
</div><h4 id='method.poll_read' class="method"><span id='poll_read.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.AsyncRead.html#method.poll_read' class='fnname'>poll_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="enum" href="../../tokio/prelude/enum.Async.html" title="enum tokio::prelude::Async">Async</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='../../src/tokio_io/async_read.rs.html#79-87' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Attempt to read from the <code>AsyncRead</code> into <code>buf</code>. <a href="../../tokio/prelude/trait.AsyncRead.html#method.poll_read">Read more</a></p>
|
||
</div><h4 id='method.read_buf' class="method"><span id='read_buf.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.AsyncRead.html#method.read_buf' class='fnname'>read_buf</a><B>(&mut self, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>B) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="../../tokio/prelude/enum.Async.html" title="enum tokio::prelude::Async">Async</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>> <span class="where fmt-newline">where<br> B: <a class="trait" href="../../bytes/buf/buf_mut/trait.BufMut.html" title="trait bytes::buf::buf_mut::BufMut">BufMut</a>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/tokio_io/async_read.rs.html#95-114' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Pull some bytes from this source into the specified <code>Buf</code>, returning how many bytes were read. <a href="../../tokio/prelude/trait.AsyncRead.html#method.read_buf">Read more</a></p>
|
||
</div><h4 id='method.framed' class="method"><span id='framed.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.AsyncRead.html#method.framed' class='fnname'>framed</a><T>(self, codec: T) -> Framed<Self, T> <span class="where fmt-newline">where<br> Self: <a class="trait" href="../../tokio/prelude/trait.AsyncWrite.html" title="trait tokio::prelude::AsyncWrite">AsyncWrite</a>,<br> T: <a class="trait" href="../../tokio_io/codec/decoder/trait.Decoder.html" title="trait tokio_io::codec::decoder::Decoder">Decoder</a> + <a class="trait" href="../../tokio_io/codec/encoder/trait.Encoder.html" title="trait tokio_io::codec::encoder::Encoder">Encoder</a>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/tokio_io/async_read.rs.html#135-139' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='stability'><div class='stab deprecated'>Deprecated since 0.1.7<p>: Use tokio_codec::Decoder::framed instead</p>
|
||
</div></div><div class='docblock'><p>Provides a <code>Stream</code> and <code>Sink</code> interface for reading and writing to this <code>Io</code> object, using <code>Decode</code> and <code>Encode</code> to read and write the raw data. <a href="../../tokio/prelude/trait.AsyncRead.html#method.framed">Read more</a></p>
|
||
</div><h4 id='method.split' class="method"><span id='split.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.AsyncRead.html#method.split' class='fnname'>split</a>(self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="struct" href="../../tokio/io/struct.ReadHalf.html" title="struct tokio::io::ReadHalf">ReadHalf</a><Self>, <a class="struct" href="../../tokio/io/struct.WriteHalf.html" title="struct tokio::io::WriteHalf">WriteHalf</a><Self><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a> <span class="where fmt-newline">where<br> Self: <a class="trait" href="../../tokio/prelude/trait.AsyncWrite.html" title="trait tokio::prelude::AsyncWrite">AsyncWrite</a>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/tokio_io/async_read.rs.html#145-149' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Helper method for splitting this read/write object into two halves. <a href="../../tokio/prelude/trait.AsyncRead.html#method.split">Read more</a></p>
|
||
</div></div><h3 id='impl-AsyncWrite' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../../tokio/prelude/trait.AsyncWrite.html" title="trait tokio::prelude::AsyncWrite">AsyncWrite</a> for <a class="struct" href="../../tokio/fs/struct.File.html" title="struct tokio::fs::File">File</a></code><a href='#impl-AsyncWrite' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/tokio_fs/file/mod.rs.html#206-213' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.shutdown' class="method"><span id='shutdown.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.AsyncWrite.html#tymethod.shutdown' class='fnname'>shutdown</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="../../tokio/prelude/enum.Async.html" title="enum tokio::prelude::Async">Async</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='../../src/tokio_fs/file/mod.rs.html#207-212' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Initiates or attempts to shut down this writer, returning success when the I/O connection has completely shut down. <a href="../../tokio/prelude/trait.AsyncWrite.html#tymethod.shutdown">Read more</a></p>
|
||
</div><h4 id='method.poll_write' class="method"><span id='poll_write.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.AsyncWrite.html#method.poll_write' class='fnname'>poll_write</a>(&mut self, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</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="enum" href="../../tokio/prelude/enum.Async.html" title="enum tokio::prelude::Async">Async</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='../../src/tokio_io/async_write.rs.html#45-53' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Attempt to write bytes from <code>buf</code> into the object. <a href="../../tokio/prelude/trait.AsyncWrite.html#method.poll_write">Read more</a></p>
|
||
</div><h4 id='method.poll_flush' class="method"><span id='poll_flush.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.AsyncWrite.html#method.poll_flush' class='fnname'>poll_flush</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="../../tokio/prelude/enum.Async.html" title="enum tokio::prelude::Async">Async</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='../../src/tokio_io/async_write.rs.html#64-72' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Attempt to flush the object, ensuring that any buffered data reach their destination. <a href="../../tokio/prelude/trait.AsyncWrite.html#method.poll_flush">Read more</a></p>
|
||
</div><h4 id='method.write_buf' class="method"><span id='write_buf.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../tokio/prelude/trait.AsyncWrite.html#method.write_buf' class='fnname'>write_buf</a><B>(&mut self, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>B) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="enum" href="../../tokio/prelude/enum.Async.html" title="enum tokio::prelude::Async">Async</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>> <span class="where fmt-newline">where<br> B: <a class="trait" href="../../bytes/buf/buf/trait.Buf.html" title="trait bytes::buf::buf::Buf">Buf</a>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/tokio_io/async_write.rs.html#138-148' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Write a <code>Buf</code> into this value, returning how many bytes were written. <a href="../../tokio/prelude/trait.AsyncWrite.html#method.write_buf">Read more</a></p>
|
||
</div></div></div>
|
||
<h2 id='synthetic-implementations' class='small-section-header'>
|
||
Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a>
|
||
</h2>
|
||
<div id='synthetic-implementations-list'>
|
||
<h3 id='impl-Send' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../tokio/fs/struct.File.html" title="struct tokio::fs::File">File</a></code><a href='#impl-Send' class='anchor'></a></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../tokio/fs/struct.File.html" title="struct tokio::fs::File">File</a></code><a href='#impl-Sync' class='anchor'></a></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></div></div></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> |