415 lines
No EOL
20 KiB
HTML
415 lines
No EOL
20 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 `tokio_fs` crate.">
|
||
<meta name="keywords" content="rust, rustlang, rust-lang, tokio_fs">
|
||
|
||
<title>tokio_fs - 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="../main.css" id="themeStyle">
|
||
<script src="../storage.js"></script>
|
||
|
||
|
||
|
||
|
||
</head>
|
||
<body class="rustdoc mod">
|
||
<!--[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'>Crate tokio_fs</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#reexports">Re-exports</a></li><li><a href="#modules">Modules</a></li><li><a href="#structs">Structs</a></li><li><a href="#functions">Functions</a></li></ul></div><p class='location'></p><script>window.sidebarCurrent = {name: 'tokio_fs', ty: 'mod', relpath: '../'};</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'>Crate <a class="mod" href=''>tokio_fs</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/lib.rs.html#1-104' title='goto source code'>[src]</a></span></h1>
|
||
<div class='docblock'><p>Asynchronous file and standard stream adaptation.</p>
|
||
<p>This module contains utility methods and adapter types for input/output to
|
||
files or standard streams (<code>Stdin</code>, <code>Stdout</code>, <code>Stderr</code>), and
|
||
filesystem manipulation, for use within (and only within) a Tokio runtime.</p>
|
||
<p>Tasks run by <em>worker</em> threads should not block, as this could delay
|
||
servicing reactor events. Portable filesystem operations are blocking,
|
||
however. This module offers adapters which use a <a href="https://docs.rs/tokio-threadpool/0.1/tokio_threadpool/fn.blocking.html"><code>blocking</code></a> annotation
|
||
to inform the runtime that a blocking operation is required. When
|
||
necessary, this allows the runtime to convert the current thread from a
|
||
<em>worker</em> to a <em>backup</em> thread, where blocking is acceptable.</p>
|
||
<h2 id="usage" class="section-header"><a href="#usage">Usage</a></h2>
|
||
<p>Where possible, users should prefer the provided asynchronous-specific
|
||
traits such as <a href="https://docs.rs/tokio-io/0.1/tokio_io/trait.AsyncRead.html"><code>AsyncRead</code></a>, or methods returning a <code>Future</code> or <code>Poll</code>
|
||
type. Adaptions also extend to traits like <code>std::io::Read</code> where methods
|
||
return <code>std::io::Result</code>. Be warned that these adapted methods may return
|
||
<code>std::io::ErrorKind::WouldBlock</code> if a <em>worker</em> thread can not be converted
|
||
to a <em>backup</em> thread immediately. See <a href="https://docs.rs/tokio-threadpool/0.1/tokio_threadpool">tokio-threadpool</a> for more details
|
||
of the threading model and <a href="https://docs.rs/tokio-threadpool/0.1/tokio_threadpool/fn.blocking.html"><code>blocking</code></a>.</p>
|
||
</div><h2 id='reexports' class='section-header'><a href="#reexports">Re-exports</a></h2>
|
||
<table><tr><td><code>pub use file::<a class="struct" href="../tokio_fs/file/struct.File.html" title="struct tokio_fs::file::File">File</a>;</code></td></tr></table><h2 id='modules' class='section-header'><a href="#modules">Modules</a></h2>
|
||
<table>
|
||
<tr class=' module-item'>
|
||
<td><a class="mod" href="file/index.html"
|
||
title='mod tokio_fs::file'>file</a></td>
|
||
<td class='docblock-short'>
|
||
<p>Types for working with <a href="file/struct.File.html"><code>File</code></a>.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="mod" href="os/index.html"
|
||
title='mod tokio_fs::os'>os</a></td>
|
||
<td class='docblock-short'>
|
||
<p>OS-specific functionality.</p>
|
||
|
||
</td>
|
||
</tr></table><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
|
||
<table>
|
||
<tr class=' module-item'>
|
||
<td><a class="struct" href="struct.CreateDirAllFuture.html"
|
||
title='struct tokio_fs::CreateDirAllFuture'>CreateDirAllFuture</a></td>
|
||
<td class='docblock-short'>
|
||
<p>Future returned by <code>create_dir_all</code>.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="struct" href="struct.CreateDirFuture.html"
|
||
title='struct tokio_fs::CreateDirFuture'>CreateDirFuture</a></td>
|
||
<td class='docblock-short'>
|
||
<p>Future returned by <code>create_dir</code>.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="struct" href="struct.DirEntry.html"
|
||
title='struct tokio_fs::DirEntry'>DirEntry</a></td>
|
||
<td class='docblock-short'>
|
||
<p>Entries returned by the <a href="struct.ReadDir.html"><code>ReadDir</code></a> stream.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="struct" href="struct.HardLinkFuture.html"
|
||
title='struct tokio_fs::HardLinkFuture'>HardLinkFuture</a></td>
|
||
<td class='docblock-short'>
|
||
<p>Future returned by <code>hard_link</code>.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="struct" href="struct.MetadataFuture.html"
|
||
title='struct tokio_fs::MetadataFuture'>MetadataFuture</a></td>
|
||
<td class='docblock-short'>
|
||
<p>Future returned by <code>metadata</code>.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="struct" href="struct.OpenOptions.html"
|
||
title='struct tokio_fs::OpenOptions'>OpenOptions</a></td>
|
||
<td class='docblock-short'>
|
||
<p>Options and flags which can be used to configure how a file is opened.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="struct" href="struct.ReadDir.html"
|
||
title='struct tokio_fs::ReadDir'>ReadDir</a></td>
|
||
<td class='docblock-short'>
|
||
<p>Stream of the entries in a directory.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="struct" href="struct.ReadDirFuture.html"
|
||
title='struct tokio_fs::ReadDirFuture'>ReadDirFuture</a></td>
|
||
<td class='docblock-short'>
|
||
<p>Future returned by <code>read_dir</code>.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="struct" href="struct.ReadLinkFuture.html"
|
||
title='struct tokio_fs::ReadLinkFuture'>ReadLinkFuture</a></td>
|
||
<td class='docblock-short'>
|
||
<p>Future returned by <code>read_link</code>.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="struct" href="struct.RemoveDirFuture.html"
|
||
title='struct tokio_fs::RemoveDirFuture'>RemoveDirFuture</a></td>
|
||
<td class='docblock-short'>
|
||
<p>Future returned by <code>remove_dir</code>.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="struct" href="struct.RemoveFileFuture.html"
|
||
title='struct tokio_fs::RemoveFileFuture'>RemoveFileFuture</a></td>
|
||
<td class='docblock-short'>
|
||
<p>Future returned by <code>remove_file</code>.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="struct" href="struct.RenameFuture.html"
|
||
title='struct tokio_fs::RenameFuture'>RenameFuture</a></td>
|
||
<td class='docblock-short'>
|
||
<p>Future returned by <code>rename</code>.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="struct" href="struct.SetPermissionsFuture.html"
|
||
title='struct tokio_fs::SetPermissionsFuture'>SetPermissionsFuture</a></td>
|
||
<td class='docblock-short'>
|
||
<p>Future returned by <code>set_permissions</code>.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="struct" href="struct.Stderr.html"
|
||
title='struct tokio_fs::Stderr'>Stderr</a></td>
|
||
<td class='docblock-short'>
|
||
<p>A handle to the standard error stream of a process.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="struct" href="struct.Stdin.html"
|
||
title='struct tokio_fs::Stdin'>Stdin</a></td>
|
||
<td class='docblock-short'>
|
||
<p>A handle to the standard input stream of a process.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="struct" href="struct.Stdout.html"
|
||
title='struct tokio_fs::Stdout'>Stdout</a></td>
|
||
<td class='docblock-short'>
|
||
<p>A handle to the standard output stream of a process.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="struct" href="struct.SymlinkMetadataFuture.html"
|
||
title='struct tokio_fs::SymlinkMetadataFuture'>SymlinkMetadataFuture</a></td>
|
||
<td class='docblock-short'>
|
||
<p>Future returned by <code>symlink_metadata</code>.</p>
|
||
|
||
</td>
|
||
</tr></table><h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2>
|
||
<table>
|
||
<tr class=' module-item'>
|
||
<td><a class="fn" href="fn.create_dir.html"
|
||
title='fn tokio_fs::create_dir'>create_dir</a></td>
|
||
<td class='docblock-short'>
|
||
<p>Creates a new, empty directory at the provided path</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="fn" href="fn.create_dir_all.html"
|
||
title='fn tokio_fs::create_dir_all'>create_dir_all</a></td>
|
||
<td class='docblock-short'>
|
||
<p>Recursively create a directory and all of its parent components if they
|
||
are missing.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="fn" href="fn.hard_link.html"
|
||
title='fn tokio_fs::hard_link'>hard_link</a></td>
|
||
<td class='docblock-short'>
|
||
<p>Creates a new hard link on the filesystem.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="fn" href="fn.metadata.html"
|
||
title='fn tokio_fs::metadata'>metadata</a></td>
|
||
<td class='docblock-short'>
|
||
<p>Queries the file system metadata for a path.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="fn" href="fn.read_dir.html"
|
||
title='fn tokio_fs::read_dir'>read_dir</a></td>
|
||
<td class='docblock-short'>
|
||
<p>Returns a stream over the entries within a directory.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="fn" href="fn.read_link.html"
|
||
title='fn tokio_fs::read_link'>read_link</a></td>
|
||
<td class='docblock-short'>
|
||
<p>Reads a symbolic link, returning the file that the link points to.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="fn" href="fn.remove_dir.html"
|
||
title='fn tokio_fs::remove_dir'>remove_dir</a></td>
|
||
<td class='docblock-short'>
|
||
<p>Removes an existing, empty directory.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="fn" href="fn.remove_file.html"
|
||
title='fn tokio_fs::remove_file'>remove_file</a></td>
|
||
<td class='docblock-short'>
|
||
<p>Removes a file from the filesystem.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="fn" href="fn.rename.html"
|
||
title='fn tokio_fs::rename'>rename</a></td>
|
||
<td class='docblock-short'>
|
||
<p>Rename a file or directory to a new name, replacing the original file if
|
||
<code>to</code> already exists.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="fn" href="fn.set_permissions.html"
|
||
title='fn tokio_fs::set_permissions'>set_permissions</a></td>
|
||
<td class='docblock-short'>
|
||
<p>Changes the permissions found on a file or a directory.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="fn" href="fn.stderr.html"
|
||
title='fn tokio_fs::stderr'>stderr</a></td>
|
||
<td class='docblock-short'>
|
||
<p>Constructs a new handle to the standard error of the current process.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="fn" href="fn.stdin.html"
|
||
title='fn tokio_fs::stdin'>stdin</a></td>
|
||
<td class='docblock-short'>
|
||
<p>Constructs a new handle to the standard input of the current process.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="fn" href="fn.stdout.html"
|
||
title='fn tokio_fs::stdout'>stdout</a></td>
|
||
<td class='docblock-short'>
|
||
<p>Constructs a new handle to the standard output of the current process.</p>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr class=' module-item'>
|
||
<td><a class="fn" href="fn.symlink_metadata.html"
|
||
title='fn tokio_fs::symlink_metadata'>symlink_metadata</a></td>
|
||
<td class='docblock-short'>
|
||
<p>Queries the file system metadata for a path.</p>
|
||
|
||
</td>
|
||
</tr></table></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_fs";
|
||
</script>
|
||
<script src="../main.js"></script>
|
||
<script defer src="../search-index.js"></script>
|
||
</body>
|
||
</html> |