deploy: de38ae62916547ad097c066f94a32e9ba7790eeb

This commit is contained in:
NotAShelf 2025-02-05 00:10:33 +00:00
commit 9a86359447
28502 changed files with 1261284 additions and 0 deletions

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -0,0 +1,29 @@
<!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="Returns the canonical, absolute form of a path with all intermediate components normalized and symbolic links resolved."><title>canonicalize in tokio::fs - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="tokio" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tokio/index.html">tokio</a><span class="version">1.42.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">canonicalize</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#platform-specific-behavior" title="Platform-specific behavior">Platform-specific behavior</a></li><li><a href="#errors" title="Errors">Errors</a></li><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>fs</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">tokio</a>::<wbr><a href="index.html">fs</a></span><h1>Function <span class="fn">canonicalize</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/tokio/fs/canonicalize.rs.html#46-49">Source</a> </span></div><pre class="rust item-decl"><code>pub async fn canonicalize(path: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/1.84.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Returns the canonical, absolute form of a path with all intermediate
components normalized and symbolic links resolved.</p>
<p>This is an async version of <a href="https://doc.rust-lang.org/1.84.1/std/fs/fn.canonicalize.html" title="fn std::fs::canonicalize"><code>std::fs::canonicalize</code></a>.</p>
<h2 id="platform-specific-behavior"><a class="doc-anchor" href="#platform-specific-behavior">§</a>Platform-specific behavior</h2>
<p>This function currently corresponds to the <code>realpath</code> function on Unix
and the <code>CreateFile</code> and <code>GetFinalPathNameByHandle</code> functions 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>
<p>On Windows, this converts the path to use <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#maxpath">extended length path</a>
syntax, which allows your program to use longer path names, but means you
can only join backslash-delimited paths to it, and it may be incompatible
with other applications (if passed to the application on the command-line,
or written to a file another application may read).</p>
<h2 id="errors"><a class="doc-anchor" href="#errors">§</a>Errors</h2>
<p>This function will return an error in the following situations, but is not
limited to just these cases:</p>
<ul>
<li><code>path</code> does not exist.</li>
<li>A non-final component in path is not a directory.</li>
</ul>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::fs;
<span class="kw">use </span>std::io;
<span class="attr">#[tokio::main]
</span><span class="kw">async fn </span>main() -&gt; io::Result&lt;()&gt; {
<span class="kw">let </span>path = fs::canonicalize(<span class="string">"../a/../foo.txt"</span>).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="prelude-val">Ok</span>(())
}</code></pre></div>
</div></details></section></div></main></body></html>

12
tokio/fs/fn.copy.html Normal file
View file

@ -0,0 +1,12 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Copies the contents of one file to another. This function will also copy the permission bits of the original file to the destination file. This function will overwrite the contents of to."><title>copy in tokio::fs - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="tokio" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tokio/index.html">tokio</a><span class="version">1.42.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">copy</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>fs</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">tokio</a>::<wbr><a href="index.html">fs</a></span><h1>Function <span class="fn">copy</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/tokio/fs/copy.rs.html#21-25">Source</a> </span></div><pre class="rust item-decl"><code>pub async fn copy(
from: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;,
to: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u64.html">u64</a>, <a class="struct" href="https://doc.rust-lang.org/1.84.1/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Copies the contents of one file to another. This function will also copy the permission bits
of the original file to the destination file.
This function will overwrite the contents of to.</p>
<p>This is the async equivalent of <a href="https://doc.rust-lang.org/1.84.1/std/fs/fn.copy.html" title="fn std::fs::copy"><code>std::fs::copy</code></a>.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::fs;
fs::copy(<span class="string">"foo.txt"</span>, <span class="string">"bar.txt"</span>).<span class="kw">await</span><span class="question-mark">?</span>;</code></pre></div>
</div></details></section></div></main></body></html>

View file

@ -0,0 +1,29 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Creates a new, empty directory at the provided path."><title>create_dir in tokio::fs - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="tokio" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tokio/index.html">tokio</a><span class="version">1.42.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">create_<wbr>dir</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#platform-specific-behavior" title="Platform-specific behavior">Platform-specific behavior</a></li><li><a href="#errors" title="Errors">Errors</a></li><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>fs</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">tokio</a>::<wbr><a href="index.html">fs</a></span><h1>Function <span class="fn">create_dir</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/tokio/fs/create_dir.rs.html#47-50">Source</a> </span></div><pre class="rust item-decl"><code>pub async fn create_dir(path: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/1.84.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Creates a new, empty directory at the provided path.</p>
<p>This is an async version of <a href="https://doc.rust-lang.org/1.84.1/std/fs/fn.create_dir.html" title="fn std::fs::create_dir"><code>std::fs::create_dir</code></a>.</p>
<h2 id="platform-specific-behavior"><a class="doc-anchor" href="#platform-specific-behavior">§</a>Platform-specific behavior</h2>
<p>This function currently corresponds to the <code>mkdir</code> function on Unix
and the <code>CreateDirectory</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>
<p><strong>NOTE</strong>: If a parent of the given path doesnt exist, this function will
return an error. To create a directory and all its missing parents at the
same time, use the <a href="fn.create_dir_all.html" title="fn tokio::fs::create_dir_all"><code>create_dir_all</code></a> function.</p>
<h2 id="errors"><a class="doc-anchor" href="#errors">§</a>Errors</h2>
<p>This function will return an error in the following situations, but is not
limited to just these cases:</p>
<ul>
<li>User lacks permissions to create directory at <code>path</code>.</li>
<li>A parent of the given path doesnt exist. (To create a directory and all
its missing parents at the same time, use the <a href="fn.create_dir_all.html" title="fn tokio::fs::create_dir_all"><code>create_dir_all</code></a>
function.)</li>
<li><code>path</code> already exists.</li>
</ul>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::fs;
<span class="kw">use </span>std::io;
<span class="attr">#[tokio::main]
</span><span class="kw">async fn </span>main() -&gt; io::Result&lt;()&gt; {
fs::create_dir(<span class="string">"/some/dir"</span>).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="prelude-val">Ok</span>(())
}</code></pre></div>
</div></details></section></div></main></body></html>

View file

@ -0,0 +1,30 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Recursively creates a directory and all of its parent components if they are missing."><title>create_dir_all in tokio::fs - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="tokio" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tokio/index.html">tokio</a><span class="version">1.42.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">create_<wbr>dir_<wbr>all</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#platform-specific-behavior" title="Platform-specific behavior">Platform-specific behavior</a></li><li><a href="#errors" title="Errors">Errors</a></li><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>fs</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">tokio</a>::<wbr><a href="index.html">fs</a></span><h1>Function <span class="fn">create_dir_all</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/tokio/fs/create_dir_all.rs.html#48-51">Source</a> </span></div><pre class="rust item-decl"><code>pub async fn create_dir_all(path: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/1.84.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Recursively creates a directory and all of its parent components if they
are missing.</p>
<p>This is an async version of <a href="https://doc.rust-lang.org/1.84.1/std/fs/fn.create_dir_all.html" title="fn std::fs::create_dir_all"><code>std::fs::create_dir_all</code></a>.</p>
<h2 id="platform-specific-behavior"><a class="doc-anchor" href="#platform-specific-behavior">§</a>Platform-specific behavior</h2>
<p>This function currently corresponds to the <code>mkdir</code> function on Unix
and the <code>CreateDirectory</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>
<h2 id="errors"><a class="doc-anchor" href="#errors">§</a>Errors</h2>
<p>This function will return an error in the following situations, but is not
limited to just these cases:</p>
<ul>
<li>If any directory in the path specified by <code>path</code> does not already exist
and it could not be created otherwise. The specific error conditions for
when a directory is being created (after it is determined to not exist) are
outlined by <a href="https://doc.rust-lang.org/1.84.1/std/fs/fn.create_dir.html" title="fn std::fs::create_dir"><code>fs::create_dir</code></a>.</li>
</ul>
<p>Notable exception is made for situations where any of the directories
specified in the <code>path</code> could not be created as it was being created concurrently.
Such cases are considered to be successful. That is, calling <code>create_dir_all</code>
concurrently from multiple threads or processes is guaranteed not to fail
due to a race condition with itself.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::fs;
<span class="attr">#[tokio::main]
</span><span class="kw">async fn </span>main() -&gt; std::io::Result&lt;()&gt; {
fs::create_dir_all(<span class="string">"/some/dir"</span>).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="prelude-val">Ok</span>(())
}</code></pre></div>
</div></details></section></div></main></body></html>

View file

@ -0,0 +1,26 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Creates a new hard link on the filesystem."><title>hard_link in tokio::fs - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="tokio" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tokio/index.html">tokio</a><span class="version">1.42.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">hard_<wbr>link</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#platform-specific-behavior" title="Platform-specific behavior">Platform-specific behavior</a></li><li><a href="#errors" title="Errors">Errors</a></li><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>fs</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">tokio</a>::<wbr><a href="index.html">fs</a></span><h1>Function <span class="fn">hard_link</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/tokio/fs/hard_link.rs.html#39-44">Source</a> </span></div><pre class="rust item-decl"><code>pub async fn hard_link(
src: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;,
dst: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;,
) -&gt; <a class="type" href="https://doc.rust-lang.org/1.84.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Creates a new hard link on the filesystem.</p>
<p>This is an async version of <a href="https://doc.rust-lang.org/1.84.1/std/fs/fn.hard_link.html" title="fn std::fs::hard_link"><code>std::fs::hard_link</code></a>.</p>
<p>The <code>dst</code> path will be a link pointing to the <code>src</code> path. Note that systems
often require these two paths to both be located on the same filesystem.</p>
<h2 id="platform-specific-behavior"><a class="doc-anchor" href="#platform-specific-behavior">§</a>Platform-specific behavior</h2>
<p>This function currently corresponds to the <code>link</code> function on Unix
and the <code>CreateHardLink</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>
<h2 id="errors"><a class="doc-anchor" href="#errors">§</a>Errors</h2>
<p>This function will return an error in the following situations, but is not
limited to just these cases:</p>
<ul>
<li>The <code>src</code> path is not a file or doesnt exist.</li>
</ul>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::fs;
<span class="attr">#[tokio::main]
</span><span class="kw">async fn </span>main() -&gt; std::io::Result&lt;()&gt; {
fs::hard_link(<span class="string">"a.txt"</span>, <span class="string">"b.txt"</span>).<span class="kw">await</span><span class="question-mark">?</span>; <span class="comment">// Hard link a.txt to b.txt
</span><span class="prelude-val">Ok</span>(())
}</code></pre></div>
</div></details></section></div></main></body></html>

26
tokio/fs/fn.metadata.html Normal file
View file

@ -0,0 +1,26 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Given a path, queries the file system to get information about a file, directory, etc."><title>metadata in tokio::fs - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="tokio" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tokio/index.html">tokio</a><span class="version">1.42.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">metadata</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#platform-specific-behavior" title="Platform-specific behavior">Platform-specific behavior</a></li><li><a href="#errors" title="Errors">Errors</a></li><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>fs</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">tokio</a>::<wbr><a href="index.html">fs</a></span><h1>Function <span class="fn">metadata</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/tokio/fs/metadata.rs.html#43-46">Source</a> </span></div><pre class="rust item-decl"><code>pub async fn metadata(path: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/1.84.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/fs/struct.Metadata.html" title="struct std::fs::Metadata">Metadata</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Given a path, queries the file system to get information about a file,
directory, etc.</p>
<p>This is an async version of <a href="https://doc.rust-lang.org/1.84.1/std/fs/fn.metadata.html" title="fn std::fs::metadata"><code>std::fs::metadata</code></a>.</p>
<p>This function will traverse symbolic links to query information about the
destination file.</p>
<h2 id="platform-specific-behavior"><a class="doc-anchor" href="#platform-specific-behavior">§</a>Platform-specific behavior</h2>
<p>This function currently corresponds to the <code>stat</code> function on Unix and the
<code>GetFileAttributesEx</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>
<h2 id="errors"><a class="doc-anchor" href="#errors">§</a>Errors</h2>
<p>This function will return an error in the following situations, but is not
limited to just these cases:</p>
<ul>
<li>The user lacks permissions to perform <code>metadata</code> call on <code>path</code>.</li>
<li><code>path</code> does not exist.</li>
</ul>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::fs;
<span class="attr">#[tokio::main]
</span><span class="kw">async fn </span>main() -&gt; std::io::Result&lt;()&gt; {
<span class="kw">let </span>attr = fs::metadata(<span class="string">"/some/file/path.txt"</span>).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="comment">// inspect attr ...
</span><span class="prelude-val">Ok</span>(())
}</code></pre></div>
</div></details></section></div></main></body></html>

24
tokio/fs/fn.read.html Normal file
View file

@ -0,0 +1,24 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Reads the entire contents of a file into a bytes vector."><title>read in tokio::fs - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="tokio" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tokio/index.html">tokio</a><span class="version">1.42.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">read</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#errors" title="Errors">Errors</a></li><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>fs</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">tokio</a>::<wbr><a href="index.html">fs</a></span><h1>Function <span class="fn">read</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/tokio/fs/read.rs.html#46-49">Source</a> </span></div><pre class="rust item-decl"><code>pub async fn read(path: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/1.84.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.84.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u8.html">u8</a>&gt;&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Reads the entire contents of a file into a bytes vector.</p>
<p>This is an async version of <a href="https://doc.rust-lang.org/1.84.1/std/fs/fn.read.html" title="fn std::fs::read"><code>std::fs::read</code></a>.</p>
<p>This is a convenience function for using <a href="struct.File.html#method.open" title="associated function tokio::fs::File::open"><code>File::open</code></a> and <a href="../io/trait.AsyncReadExt.html#method.read_to_end" title="method tokio::io::AsyncReadExt::read_to_end"><code>read_to_end</code></a>
with fewer imports and without an intermediate variable. It pre-allocates a
buffer based on the file size when available, so it is generally faster than
reading into a vector created with <code>Vec::new()</code>.</p>
<p>This operation is implemented by running the equivalent blocking operation
on a separate thread pool using <a href="../task/fn.spawn_blocking.html" title="fn tokio::task::spawn_blocking"><code>spawn_blocking</code></a>.</p>
<h2 id="errors"><a class="doc-anchor" href="#errors">§</a>Errors</h2>
<p>This function will return an error if <code>path</code> does not already exist.
Other errors may also be returned according to <a href="struct.OpenOptions.html#method.open" title="method tokio::fs::OpenOptions::open"><code>OpenOptions::open</code></a>.</p>
<p>It will also return an error if it encounters while reading an error
of a kind other than <a href="https://doc.rust-lang.org/1.84.1/std/io/error/enum.ErrorKind.html#variant.Interrupted" title="variant std::io::error::ErrorKind::Interrupted"><code>ErrorKind::Interrupted</code></a>.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::fs;
<span class="kw">use </span>std::net::SocketAddr;
<span class="attr">#[tokio::main]
</span><span class="kw">async fn </span>main() -&gt; <span class="prelude-ty">Result</span>&lt;(), Box&lt;<span class="kw">dyn </span>std::error::Error + <span class="lifetime">'static</span>&gt;&gt; {
<span class="kw">let </span>contents = fs::read(<span class="string">"address.txt"</span>).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="kw">let </span>foo: SocketAddr = String::from_utf8_lossy(<span class="kw-2">&amp;</span>contents).parse()<span class="question-mark">?</span>;
<span class="prelude-val">Ok</span>(())
}</code></pre></div>
</div></details></section></div></main></body></html>

View file

@ -0,0 +1,5 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Returns a stream over the entries within a directory."><title>read_dir in tokio::fs - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="tokio" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tokio/index.html">tokio</a><span class="version">1.42.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>fs</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">tokio</a>::<wbr><a href="index.html">fs</a></span><h1>Function <span class="fn">read_dir</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/tokio/fs/read_dir.rs.html#32-42">Source</a> </span></div><pre class="rust item-decl"><code>pub async fn read_dir(path: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/1.84.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="struct" href="struct.ReadDir.html" title="struct tokio::fs::ReadDir">ReadDir</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Returns a stream over the entries within a directory.</p>
<p>This is an async version of <a href="https://doc.rust-lang.org/1.84.1/std/fs/fn.read_dir.html" title="fn std::fs::read_dir"><code>std::fs::read_dir</code></a>.</p>
<p>This operation is implemented by running the equivalent blocking
operation on a separate thread pool using <a href="../task/fn.spawn_blocking.html" title="fn tokio::task::spawn_blocking"><code>spawn_blocking</code></a>.</p>
</div></details></section></div></main></body></html>

View file

@ -0,0 +1,3 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Reads a symbolic link, returning the file that the link points to."><title>read_link in tokio::fs - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="tokio" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tokio/index.html">tokio</a><span class="version">1.42.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>fs</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">tokio</a>::<wbr><a href="index.html">fs</a></span><h1>Function <span class="fn">read_link</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/tokio/fs/read_link.rs.html#9-12">Source</a> </span></div><pre class="rust item-decl"><code>pub async fn read_link(path: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/1.84.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Reads a symbolic link, returning the file that the link points to.</p>
<p>This is an async version of <a href="https://doc.rust-lang.org/1.84.1/std/fs/fn.read_link.html" title="fn std::fs::read_link"><code>std::fs::read_link</code></a>.</p>
</div></details></section></div></main></body></html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Creates a future which will open a file for reading and read the entire contents into a string and return said string."><title>read_to_string in tokio::fs - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="tokio" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tokio/index.html">tokio</a><span class="version">1.42.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">read_<wbr>to_<wbr>string</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>fs</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">tokio</a>::<wbr><a href="index.html">fs</a></span><h1>Function <span class="fn">read_to_string</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/tokio/fs/read_to_string.rs.html#27-30">Source</a> </span></div><pre class="rust item-decl"><code>pub async fn read_to_string(path: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/1.84.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.84.1/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Creates a future which will open a file for reading and read the entire
contents into a string and return said string.</p>
<p>This is the async equivalent of <a href="https://doc.rust-lang.org/1.84.1/std/fs/fn.read_to_string.html" title="fn std::fs::read_to_string"><code>std::fs::read_to_string</code></a>.</p>
<p>This operation is implemented by running the equivalent blocking operation
on a separate thread pool using <a href="../task/fn.spawn_blocking.html" title="fn tokio::task::spawn_blocking"><code>spawn_blocking</code></a>.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::fs;
<span class="kw">let </span>contents = fs::read_to_string(<span class="string">"foo.txt"</span>).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="macro">println!</span>(<span class="string">"foo.txt contains {} bytes"</span>, contents.len());</code></pre></div>
</div></details></section></div></main></body></html>

View file

@ -0,0 +1,3 @@
<!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="Removes an existing, empty directory."><title>remove_dir in tokio::fs - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="tokio" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tokio/index.html">tokio</a><span class="version">1.42.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>fs</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">tokio</a>::<wbr><a href="index.html">fs</a></span><h1>Function <span class="fn">remove_dir</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/tokio/fs/remove_dir.rs.html#9-12">Source</a> </span></div><pre class="rust item-decl"><code>pub async fn remove_dir(path: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/1.84.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Removes an existing, empty directory.</p>
<p>This is an async version of <a href="https://doc.rust-lang.org/1.84.1/std/fs/fn.remove_dir.html" title="fn std::fs::remove_dir"><code>std::fs::remove_dir</code></a>.</p>
</div></details></section></div></main></body></html>

View file

@ -0,0 +1,3 @@
<!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="Removes a directory at this path, after removing all its contents. Use carefully!"><title>remove_dir_all in tokio::fs - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="tokio" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tokio/index.html">tokio</a><span class="version">1.42.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>fs</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">tokio</a>::<wbr><a href="index.html">fs</a></span><h1>Function <span class="fn">remove_dir_all</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/tokio/fs/remove_dir_all.rs.html#11-14">Source</a> </span></div><pre class="rust item-decl"><code>pub async fn remove_dir_all(path: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/1.84.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Removes a directory at this path, after removing all its contents. Use carefully!</p>
<p>This is an async version of <a href="https://doc.rust-lang.org/1.84.1/std/fs/fn.remove_dir_all.html" title="fn std::fs::remove_dir_all"><code>std::fs::remove_dir_all</code></a></p>
</div></details></section></div></main></body></html>

View file

@ -0,0 +1,6 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Removes a file from the filesystem."><title>remove_file in tokio::fs - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="tokio" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tokio/index.html">tokio</a><span class="version">1.42.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>fs</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">tokio</a>::<wbr><a href="index.html">fs</a></span><h1>Function <span class="fn">remove_file</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/tokio/fs/remove_file.rs.html#13-16">Source</a> </span></div><pre class="rust item-decl"><code>pub async fn remove_file(path: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/1.84.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Removes a file from the filesystem.</p>
<p>Note that there is no guarantee that the file is immediately deleted (e.g.
depending on platform, other open file descriptors may prevent immediate
removal).</p>
<p>This is an async version of <a href="https://doc.rust-lang.org/1.84.1/std/fs/fn.remove_file.html" title="fn std::fs::remove_file"><code>std::fs::remove_file</code></a>.</p>
</div></details></section></div></main></body></html>

5
tokio/fs/fn.rename.html Normal file
View file

@ -0,0 +1,5 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Renames a file or directory to a new name, replacing the original file if `to` already exists."><title>rename in tokio::fs - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="tokio" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tokio/index.html">tokio</a><span class="version">1.42.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>fs</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">tokio</a>::<wbr><a href="index.html">fs</a></span><h1>Function <span class="fn">rename</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/tokio/fs/rename.rs.html#12-17">Source</a> </span></div><pre class="rust item-decl"><code>pub async fn rename(from: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;, to: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/1.84.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Renames a file or directory to a new name, replacing the original file if
<code>to</code> already exists.</p>
<p>This will not work if the new name is on a different mount point.</p>
<p>This is an async version of <a href="https://doc.rust-lang.org/1.84.1/std/fs/fn.rename.html" title="fn std::fs::rename"><code>std::fs::rename</code></a>.</p>
</div></details></section></div></main></body></html>

View file

@ -0,0 +1,6 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Changes the permissions found on a file or a directory."><title>set_permissions in tokio::fs - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="tokio" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tokio/index.html">tokio</a><span class="version">1.42.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>fs</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">tokio</a>::<wbr><a href="index.html">fs</a></span><h1>Function <span class="fn">set_permissions</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/tokio/fs/set_permissions.rs.html#12-15">Source</a> </span></div><pre class="rust item-decl"><code>pub async fn set_permissions(
path: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;,
perm: <a class="struct" href="https://doc.rust-lang.org/1.84.1/std/fs/struct.Permissions.html" title="struct std::fs::Permissions">Permissions</a>,
) -&gt; <a class="type" href="https://doc.rust-lang.org/1.84.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Changes the permissions found on a file or a directory.</p>
<p>This is an async version of <a href="https://doc.rust-lang.org/1.84.1/std/fs/fn.set_permissions.html" title="fn std::fs::set_permissions"><code>std::fs::set_permissions</code></a></p>
</div></details></section></div></main></body></html>

4
tokio/fs/fn.symlink.html Normal file
View file

@ -0,0 +1,4 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Creates a new symbolic link on the filesystem."><title>symlink in tokio::fs - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="tokio" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tokio/index.html">tokio</a><span class="version">1.42.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>fs</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">tokio</a>::<wbr><a href="index.html">fs</a></span><h1>Function <span class="fn">symlink</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/tokio/fs/symlink.rs.html#11-16">Source</a> </span></div><pre class="rust item-decl"><code>pub async fn symlink(src: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;, dst: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/1.84.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Creates a new symbolic link on the filesystem.</p>
<p>The <code>dst</code> path will be a symbolic link pointing to the <code>src</code> path.</p>
<p>This is an async version of <a href="https://doc.rust-lang.org/1.84.1/std/os/unix/fs/fn.symlink.html" title="fn std::os::unix::fs::symlink"><code>std::os::unix::fs::symlink</code></a>.</p>
</div></details></section></div></main></body></html>

View file

@ -0,0 +1,3 @@
<!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="Queries the file system metadata for a path."><title>symlink_metadata in tokio::fs - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="tokio" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tokio/index.html">tokio</a><span class="version">1.42.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>fs</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">tokio</a>::<wbr><a href="index.html">fs</a></span><h1>Function <span class="fn">symlink_metadata</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/tokio/fs/symlink_metadata.rs.html#12-15">Source</a> </span></div><pre class="rust item-decl"><code>pub async fn symlink_metadata(path: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/1.84.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/fs/struct.Metadata.html" title="struct std::fs::Metadata">Metadata</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Queries the file system metadata for a path.</p>
<p>This is an async version of <a href="https://doc.rust-lang.org/1.84.1/std/fs/fn.symlink_metadata.html" title="fn std::fs::symlink_metadata"><code>std::fs::symlink_metadata</code></a></p>
</div></details></section></div></main></body></html>

View file

@ -0,0 +1,9 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Returns `Ok(true)` if the path points at an existing entity."><title>try_exists in tokio::fs - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="tokio" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tokio/index.html">tokio</a><span class="version">1.42.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">try_<wbr>exists</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>fs</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">tokio</a>::<wbr><a href="index.html">fs</a></span><h1>Function <span class="fn">try_exists</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/tokio/fs/try_exists.rs.html#25-28">Source</a> </span></div><pre class="rust item-decl"><code>pub async fn try_exists(path: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/1.84.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.bool.html">bool</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Returns <code>Ok(true)</code> if the path points at an existing entity.</p>
<p>This function will traverse symbolic links to query information about the
destination file. In case of broken symbolic links this will return <code>Ok(false)</code>.</p>
<p>This is the async equivalent of <a href="https://doc.rust-lang.org/1.84.1/std/path/struct.Path.html#method.try_exists" title="method std::path::Path::try_exists"><code>std::path::Path::try_exists</code></a>.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::fs;
fs::try_exists(<span class="string">"foo.txt"</span>).<span class="kw">await</span><span class="question-mark">?</span>;</code></pre></div>
</div></details></section></div></main></body></html>

13
tokio/fs/fn.write.html Normal file
View file

@ -0,0 +1,13 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Creates a future that will open a file for writing and write the entire contents of `contents` to it."><title>write in tokio::fs - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="tokio" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tokio/index.html">tokio</a><span class="version">1.42.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">write</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>fs</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">tokio</a>::<wbr><a href="index.html">fs</a></span><h1>Function <span class="fn">write</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/tokio/fs/write.rs.html#26-31">Source</a> </span></div><pre class="rust item-decl"><code>pub async fn write(
path: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;,
contents: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;[<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u8.html">u8</a>]&gt;,
) -&gt; <a class="type" href="https://doc.rust-lang.org/1.84.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Creates a future that will open a file for writing and write the entire
contents of <code>contents</code> to it.</p>
<p>This is the async equivalent of <a href="https://doc.rust-lang.org/1.84.1/std/fs/fn.write.html" title="fn std::fs::write"><code>std::fs::write</code></a>.</p>
<p>This operation is implemented by running the equivalent blocking operation
on a separate thread pool using <a href="../task/fn.spawn_blocking.html" title="fn tokio::task::spawn_blocking"><code>spawn_blocking</code></a>.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::fs;
fs::write(<span class="string">"foo.txt"</span>, <span class="string">b"Hello world!"</span>).<span class="kw">await</span><span class="question-mark">?</span>;</code></pre></div>
</div></details></section></div></main></body></html>

View file

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

156
tokio/fs/index.html Normal file
View file

@ -0,0 +1,156 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Asynchronous file utilities."><title>tokio::fs - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="tokio" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tokio/index.html">tokio</a><span class="version">1.42.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module fs</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#usage" title="Usage">Usage</a><ul><li><a href="#using-file" title="Using `File`">Using <code>File</code></a></li><li><a href="#tuning-your-file-io" title="Tuning your file IO">Tuning your file IO</a></li></ul></li></ul><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate tokio</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">tokio</a></span><h1>Module <span>fs</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/tokio/fs/mod.rs.html#1-317">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Asynchronous file utilities.</p>
<p>This module contains utility methods for working with the file system
asynchronously. This includes reading/writing to files, and working with
directories.</p>
<p>Be aware that most operating systems do not provide asynchronous file system
APIs. Because of that, Tokio will use ordinary blocking file operations
behind the scenes. This is done using the <a href="../task/fn.spawn_blocking.html" title="fn tokio::task::spawn_blocking"><code>spawn_blocking</code></a> threadpool to
run them in the background.</p>
<p>The <code>tokio::fs</code> module should only be used for ordinary files. Trying to use
it with e.g., a named pipe on Linux can result in surprising behavior,
such as hangs during runtime shutdown. For special files, you should use a
dedicated type such as <a href="../net/unix/pipe/index.html" title="mod tokio::net::unix::pipe"><code>tokio::net::unix::pipe</code></a> or <a href="../io/unix/struct.AsyncFd.html" title="struct tokio::io::unix::AsyncFd"><code>AsyncFd</code></a> instead.</p>
<p>Currently, Tokio will always use <a href="../task/fn.spawn_blocking.html" title="fn tokio::task::spawn_blocking"><code>spawn_blocking</code></a> on all platforms, but it
may be changed to use asynchronous file system APIs such as io_uring in the
future.</p>
<h2 id="usage"><a class="doc-anchor" href="#usage">§</a>Usage</h2>
<p>The easiest way to use this module is to use the utility functions that
operate on entire files:</p>
<ul>
<li><a href="fn.read.html" title="fn tokio::fs::read"><code>tokio::fs::read</code></a></li>
<li><a href="fn.read_to_string.html" title="fn tokio::fs::read_to_string"><code>tokio::fs::read_to_string</code></a></li>
<li><a href="fn.write.html" title="fn tokio::fs::write"><code>tokio::fs::write</code></a></li>
</ul>
<p>The two <code>read</code> functions reads the entire file and returns its contents.
The <code>write</code> function takes the contents of the file and writes those
contents to the file. It overwrites the existing file, if any.</p>
<p>For example, to read the file:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>contents = tokio::fs::read_to_string(<span class="string">"my_file.txt"</span>).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="macro">println!</span>(<span class="string">"File has {} lines."</span>, contents.lines().count());</code></pre></div>
<p>To overwrite the file:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>contents = <span class="string">"First line.\nSecond line.\nThird line.\n"</span>;
tokio::fs::write(<span class="string">"my_file.txt"</span>, contents.as_bytes()).<span class="kw">await</span><span class="question-mark">?</span>;</code></pre></div>
<h3 id="using-file"><a class="doc-anchor" href="#using-file">§</a>Using <code>File</code></h3>
<p>The main type for interacting with files is <a href="struct.File.html" title="struct tokio::fs::File"><code>File</code></a>. It can be used to read
from and write to a given file. This is done using the <a href="../io/trait.AsyncRead.html" title="trait tokio::io::AsyncRead"><code>AsyncRead</code></a> and
<a href="../io/trait.AsyncWrite.html" title="trait tokio::io::AsyncWrite"><code>AsyncWrite</code></a> traits. This type is generally used when you want to do
something more complex than just reading or writing the entire contents in
one go.</p>
<p><strong>Note:</strong> It is important to use <a href="../io/trait.AsyncWriteExt.html#method.flush" title="method tokio::io::AsyncWriteExt::flush"><code>flush</code></a> when writing to a Tokio
<a href="struct.File.html" title="struct tokio::fs::File"><code>File</code></a>. This is because calls to <code>write</code> will return before the write has
finished, and <a href="../io/trait.AsyncWriteExt.html#method.flush" title="method tokio::io::AsyncWriteExt::flush"><code>flush</code></a> will wait for the write to finish. (The write will
happen even if you dont flush; it will just happen later.) This is
different from <a href="https://doc.rust-lang.org/1.84.1/std/fs/struct.File.html" title="struct std::fs::File"><code>std::fs::File</code></a>, and is due to the fact that <code>File</code> uses
<code>spawn_blocking</code> behind the scenes.</p>
<p>For example, to count the number of lines in a file without loading the
entire file into memory:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::fs::File;
<span class="kw">use </span>tokio::io::AsyncReadExt;
<span class="kw">let </span><span class="kw-2">mut </span>file = File::open(<span class="string">"my_file.txt"</span>).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="kw">let </span><span class="kw-2">mut </span>chunk = <span class="macro">vec!</span>[<span class="number">0</span>; <span class="number">4096</span>];
<span class="kw">let </span><span class="kw-2">mut </span>number_of_lines = <span class="number">0</span>;
<span class="kw">loop </span>{
<span class="kw">let </span>len = file.read(<span class="kw-2">&amp;mut </span>chunk).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="kw">if </span>len == <span class="number">0 </span>{
<span class="comment">// Length of zero means end of file.
</span><span class="kw">break</span>;
}
<span class="kw">for </span><span class="kw-2">&amp;</span>b <span class="kw">in </span><span class="kw-2">&amp;</span>chunk[..len] {
<span class="kw">if </span>b == <span class="string">b'\n' </span>{
number_of_lines += <span class="number">1</span>;
}
}
}
<span class="macro">println!</span>(<span class="string">"File has {} lines."</span>, number_of_lines);</code></pre></div>
<p>For example, to write a file line-by-line:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::fs::File;
<span class="kw">use </span>tokio::io::AsyncWriteExt;
<span class="kw">let </span><span class="kw-2">mut </span>file = File::create(<span class="string">"my_file.txt"</span>).<span class="kw">await</span><span class="question-mark">?</span>;
file.write_all(<span class="string">b"First line.\n"</span>).<span class="kw">await</span><span class="question-mark">?</span>;
file.write_all(<span class="string">b"Second line.\n"</span>).<span class="kw">await</span><span class="question-mark">?</span>;
file.write_all(<span class="string">b"Third line.\n"</span>).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="comment">// Remember to call `flush` after writing!
</span>file.flush().<span class="kw">await</span><span class="question-mark">?</span>;</code></pre></div>
<h3 id="tuning-your-file-io"><a class="doc-anchor" href="#tuning-your-file-io">§</a>Tuning your file IO</h3>
<p>Tokios file uses <a href="../task/fn.spawn_blocking.html" title="fn tokio::task::spawn_blocking"><code>spawn_blocking</code></a> behind the scenes, and this has serious
performance consequences. To get good performance with file IO on Tokio, it
is recommended to batch your operations into as few <code>spawn_blocking</code> calls
as possible.</p>
<p>One example of this difference can be seen by comparing the two reading
examples above. The first example uses <a href="fn.read.html" title="fn tokio::fs::read"><code>tokio::fs::read</code></a>, which reads the
entire file in a single <code>spawn_blocking</code> call, and then returns it. The
second example will read the file in chunks using many <code>spawn_blocking</code>
calls. This means that the second example will most likely be more expensive
for large files. (Of course, using chunks may be necessary for very large
files that dont fit in memory.)</p>
<p>The following examples will show some strategies for this:</p>
<p>When creating a file, write the data to a <code>String</code> or <code>Vec&lt;u8&gt;</code> and then
write the entire file in a single <code>spawn_blocking</code> call with
<code>tokio::fs::write</code>.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span><span class="kw-2">mut </span>contents = String::new();
contents.push_str(<span class="string">"First line.\n"</span>);
contents.push_str(<span class="string">"Second line.\n"</span>);
contents.push_str(<span class="string">"Third line.\n"</span>);
tokio::fs::write(<span class="string">"my_file.txt"</span>, contents.as_bytes()).<span class="kw">await</span><span class="question-mark">?</span>;</code></pre></div>
<p>Use <a href="../io/struct.BufReader.html" title="struct tokio::io::BufReader"><code>BufReader</code></a> and <a href="../io/struct.BufWriter.html" title="struct tokio::io::BufWriter"><code>BufWriter</code></a> to buffer many small reads or writes
into a few large ones. This example will most likely only perform one
<code>spawn_blocking</code> call.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::fs::File;
<span class="kw">use </span>tokio::io::{AsyncWriteExt, BufWriter};
<span class="kw">let </span><span class="kw-2">mut </span>file = BufWriter::new(File::create(<span class="string">"my_file.txt"</span>).<span class="kw">await</span><span class="question-mark">?</span>);
file.write_all(<span class="string">b"First line.\n"</span>).<span class="kw">await</span><span class="question-mark">?</span>;
file.write_all(<span class="string">b"Second line.\n"</span>).<span class="kw">await</span><span class="question-mark">?</span>;
file.write_all(<span class="string">b"Third line.\n"</span>).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="comment">// Due to the BufWriter, the actual write and spawn_blocking
// call happens when you flush.
</span>file.flush().<span class="kw">await</span><span class="question-mark">?</span>;</code></pre></div>
<p>Manually use <a href="https://doc.rust-lang.org/1.84.1/std/fs/index.html" title="mod std::fs"><code>std::fs</code></a> inside <a href="../task/fn.spawn_blocking.html" title="fn tokio::task::spawn_blocking"><code>spawn_blocking</code></a>.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::fs::File;
<span class="kw">use </span>std::io::{<span class="self">self</span>, Write};
<span class="kw">use </span>tokio::task::spawn_blocking;
spawn_blocking(<span class="kw">move </span>|| {
<span class="kw">let </span><span class="kw-2">mut </span>file = File::create(<span class="string">"my_file.txt"</span>)<span class="question-mark">?</span>;
file.write_all(<span class="string">b"First line.\n"</span>)<span class="question-mark">?</span>;
file.write_all(<span class="string">b"Second line.\n"</span>)<span class="question-mark">?</span>;
file.write_all(<span class="string">b"Third line.\n"</span>)<span class="question-mark">?</span>;
<span class="comment">// Unlike Tokio's file, the std::fs file does
// not need flush.
</span>io::Result::Ok(())
}).<span class="kw">await</span>.unwrap()<span class="question-mark">?</span>;</code></pre></div>
<p>Its also good to be aware of <a href="struct.File.html#method.set_max_buf_size" title="method tokio::fs::File::set_max_buf_size"><code>File::set_max_buf_size</code></a>, which controls the
maximum amount of bytes that Tokios <a href="struct.File.html" title="struct tokio::fs::File"><code>File</code></a> will read or write in a single
<a href="../task/fn.spawn_blocking.html" title="fn tokio::task::spawn_blocking"><code>spawn_blocking</code></a> call. The default is two megabytes, but this is subject
to change.</p>
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="struct" href="struct.DirBuilder.html" title="struct tokio::fs::DirBuilder">DirBuilder</a></div><div class="desc docblock-short">A builder for creating directories in various manners.</div></li><li><div class="item-name"><a class="struct" href="struct.DirEntry.html" title="struct tokio::fs::DirEntry">DirEntry</a></div><div class="desc docblock-short">Entries returned by the <a href="struct.ReadDir.html" title="struct tokio::fs::ReadDir"><code>ReadDir</code></a> stream.</div></li><li><div class="item-name"><a class="struct" href="struct.File.html" title="struct tokio::fs::File">File</a></div><div class="desc docblock-short">A reference to an open file on the filesystem.</div></li><li><div class="item-name"><a class="struct" href="struct.OpenOptions.html" title="struct tokio::fs::OpenOptions">Open<wbr>Options</a></div><div class="desc docblock-short">Options and flags which can be used to configure how a file is opened.</div></li><li><div class="item-name"><a class="struct" href="struct.ReadDir.html" title="struct tokio::fs::ReadDir">ReadDir</a></div><div class="desc docblock-short">Reads the entries in a directory.</div></li></ul><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="fn" href="fn.canonicalize.html" title="fn tokio::fs::canonicalize">canonicalize</a></div><div class="desc docblock-short">Returns the canonical, absolute form of a path with all intermediate
components normalized and symbolic links resolved.</div></li><li><div class="item-name"><a class="fn" href="fn.copy.html" title="fn tokio::fs::copy">copy</a></div><div class="desc docblock-short">Copies the contents of one file to another. This function will also copy the permission bits
of the original file to the destination file.
This function will overwrite the contents of to.</div></li><li><div class="item-name"><a class="fn" href="fn.create_dir.html" title="fn tokio::fs::create_dir">create_<wbr>dir</a></div><div class="desc docblock-short">Creates a new, empty directory at the provided path.</div></li><li><div class="item-name"><a class="fn" href="fn.create_dir_all.html" title="fn tokio::fs::create_dir_all">create_<wbr>dir_<wbr>all</a></div><div class="desc docblock-short">Recursively creates a directory and all of its parent components if they
are missing.</div></li><li><div class="item-name"><a class="fn" href="fn.hard_link.html" title="fn tokio::fs::hard_link">hard_<wbr>link</a></div><div class="desc docblock-short">Creates a new hard link on the filesystem.</div></li><li><div class="item-name"><a class="fn" href="fn.metadata.html" title="fn tokio::fs::metadata">metadata</a></div><div class="desc docblock-short">Given a path, queries the file system to get information about a file,
directory, etc.</div></li><li><div class="item-name"><a class="fn" href="fn.read.html" title="fn tokio::fs::read">read</a></div><div class="desc docblock-short">Reads the entire contents of a file into a bytes vector.</div></li><li><div class="item-name"><a class="fn" href="fn.read_dir.html" title="fn tokio::fs::read_dir">read_<wbr>dir</a></div><div class="desc docblock-short">Returns a stream over the entries within a directory.</div></li><li><div class="item-name"><a class="fn" href="fn.read_link.html" title="fn tokio::fs::read_link">read_<wbr>link</a></div><div class="desc docblock-short">Reads a symbolic link, returning the file that the link points to.</div></li><li><div class="item-name"><a class="fn" href="fn.read_to_string.html" title="fn tokio::fs::read_to_string">read_<wbr>to_<wbr>string</a></div><div class="desc docblock-short">Creates a future which will open a file for reading and read the entire
contents into a string and return said string.</div></li><li><div class="item-name"><a class="fn" href="fn.remove_dir.html" title="fn tokio::fs::remove_dir">remove_<wbr>dir</a></div><div class="desc docblock-short">Removes an existing, empty directory.</div></li><li><div class="item-name"><a class="fn" href="fn.remove_dir_all.html" title="fn tokio::fs::remove_dir_all">remove_<wbr>dir_<wbr>all</a></div><div class="desc docblock-short">Removes a directory at this path, after removing all its contents. Use carefully!</div></li><li><div class="item-name"><a class="fn" href="fn.remove_file.html" title="fn tokio::fs::remove_file">remove_<wbr>file</a></div><div class="desc docblock-short">Removes a file from the filesystem.</div></li><li><div class="item-name"><a class="fn" href="fn.rename.html" title="fn tokio::fs::rename">rename</a></div><div class="desc docblock-short">Renames a file or directory to a new name, replacing the original file if
<code>to</code> already exists.</div></li><li><div class="item-name"><a class="fn" href="fn.set_permissions.html" title="fn tokio::fs::set_permissions">set_<wbr>permissions</a></div><div class="desc docblock-short">Changes the permissions found on a file or a directory.</div></li><li><div class="item-name"><a class="fn" href="fn.symlink.html" title="fn tokio::fs::symlink">symlink</a></div><div class="desc docblock-short">Creates a new symbolic link on the filesystem.</div></li><li><div class="item-name"><a class="fn" href="fn.symlink_metadata.html" title="fn tokio::fs::symlink_metadata">symlink_<wbr>metadata</a></div><div class="desc docblock-short">Queries the file system metadata for a path.</div></li><li><div class="item-name"><a class="fn" href="fn.try_exists.html" title="fn tokio::fs::try_exists">try_<wbr>exists</a></div><div class="desc docblock-short">Returns <code>Ok(true)</code> if the path points at an existing entity.</div></li><li><div class="item-name"><a class="fn" href="fn.write.html" title="fn tokio::fs::write">write</a></div><div class="desc docblock-short">Creates a future that will open a file for writing and write the entire
contents of <code>contents</code> to it.</div></li></ul></section></div></main></body></html>

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"fn":["canonicalize","copy","create_dir","create_dir_all","hard_link","metadata","read","read_dir","read_link","read_to_string","remove_dir","remove_dir_all","remove_file","rename","set_permissions","symlink","symlink_metadata","try_exists","write"],"struct":["DirBuilder","DirEntry","File","OpenOptions","ReadDir"]};

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,93 @@
<!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="Entries returned by the `ReadDir` stream."><title>DirEntry in tokio::fs - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="tokio" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tokio/index.html">tokio</a><span class="version">1.42.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">DirEntry</a></h2><h3><a href="#implementations">Methods</a></h3><ul class="block method"><li><a href="#method.file_name" title="file_name">file_name</a></li><li><a href="#method.file_type" title="file_type">file_type</a></li><li><a href="#method.ino" title="ino">ino</a></li><li><a href="#method.metadata" title="metadata">metadata</a></li><li><a href="#method.path" title="path">path</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-Debug-for-DirEntry" title="Debug">Debug</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-Freeze-for-DirEntry" title="Freeze">Freeze</a></li><li><a href="#impl-RefUnwindSafe-for-DirEntry" title="RefUnwindSafe">RefUnwindSafe</a></li><li><a href="#impl-Send-for-DirEntry" title="Send">Send</a></li><li><a href="#impl-Sync-for-DirEntry" title="Sync">Sync</a></li><li><a href="#impl-Unpin-for-DirEntry" title="Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe-for-DirEntry" title="UnwindSafe">UnwindSafe</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block blanket-implementation"><li><a href="#impl-Any-for-T" title="Any">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-T" title="Borrow&#60;T&#62;">Borrow&#60;T&#62;</a></li><li><a href="#impl-BorrowMut%3CT%3E-for-T" title="BorrowMut&#60;T&#62;">BorrowMut&#60;T&#62;</a></li><li><a href="#impl-From%3CT%3E-for-T" title="From&#60;T&#62;">From&#60;T&#62;</a></li><li><a href="#impl-Into%3CU%3E-for-T" title="Into&#60;U&#62;">Into&#60;U&#62;</a></li><li><a href="#impl-TryFrom%3CU%3E-for-T" title="TryFrom&#60;U&#62;">TryFrom&#60;U&#62;</a></li><li><a href="#impl-TryInto%3CU%3E-for-T" title="TryInto&#60;U&#62;">TryInto&#60;U&#62;</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>fs</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">tokio</a>::<wbr><a href="index.html">fs</a></span><h1>Struct <span class="struct">DirEntry</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/tokio/fs/read_dir.rs.html#200-212">Source</a> </span></div><pre class="rust item-decl"><code>pub struct DirEntry { <span class="comment">/* private fields */</span> }</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Entries returned by the <a href="struct.ReadDir.html" title="struct tokio::fs::ReadDir"><code>ReadDir</code></a> stream.</p>
<p>This is a specialized version of <a href="https://doc.rust-lang.org/1.84.1/std/fs/struct.DirEntry.html" title="struct std::fs::DirEntry"><code>std::fs::DirEntry</code></a> for usage from the
Tokio runtime.</p>
<p>An instance of <code>DirEntry</code> represents an entry inside of a directory on the
filesystem. Each entry can be inspected via methods to learn about the full
path or possibly other metadata through per-platform extension traits.</p>
</div></details><h2 id="implementations" class="section-header">Implementations<a href="#implementations" class="anchor">§</a></h2><div id="implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-DirEntry" class="impl"><a class="src rightside" href="../../src/tokio/fs/read_dir.rs.html#164-186">Source</a><a href="#impl-DirEntry" class="anchor">§</a><h3 class="code-header">impl <a class="struct" href="struct.DirEntry.html" title="struct tokio::fs::DirEntry">DirEntry</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.ino" class="method"><a class="src rightside" href="../../src/tokio/fs/read_dir.rs.html#183-185">Source</a><h4 class="code-header">pub fn <a href="#method.ino" class="fn">ino</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u64.html">u64</a></h4></section></summary><div class="docblock"><p>Returns the underlying <code>d_ino</code> field in the contained <code>dirent</code>
structure.</p>
<h5 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::fs;
<span class="kw">let </span><span class="kw-2">mut </span>entries = fs::read_dir(<span class="string">"."</span>).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="kw">while let </span><span class="prelude-val">Some</span>(entry) = entries.next_entry().<span class="kw">await</span><span class="question-mark">? </span>{
<span class="comment">// Here, `entry` is a `DirEntry`.
</span><span class="macro">println!</span>(<span class="string">"{:?}: {}"</span>, entry.file_name(), entry.ino());
}</code></pre></div>
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-DirEntry-1" class="impl"><a class="src rightside" href="../../src/tokio/fs/read_dir.rs.html#214-357">Source</a><a href="#impl-DirEntry-1" class="anchor">§</a><h3 class="code-header">impl <a class="struct" href="struct.DirEntry.html" title="struct tokio::fs::DirEntry">DirEntry</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.path" class="method"><a class="src rightside" href="../../src/tokio/fs/read_dir.rs.html#244-246">Source</a><h4 class="code-header">pub fn <a href="#method.path" class="fn">path</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.84.1/std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></h4></section></summary><div class="docblock"><p>Returns the full path to the file that this entry represents.</p>
<p>The full path is created by joining the original path to <code>read_dir</code>
with the filename of this entry.</p>
<h5 id="examples-1"><a class="doc-anchor" href="#examples-1">§</a>Examples</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::fs;
<span class="kw">let </span><span class="kw-2">mut </span>entries = fs::read_dir(<span class="string">"."</span>).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="kw">while let </span><span class="prelude-val">Some</span>(entry) = entries.next_entry().<span class="kw">await</span><span class="question-mark">? </span>{
<span class="macro">println!</span>(<span class="string">"{:?}"</span>, entry.path());
}</code></pre></div>
<p>This prints output like:</p>
<div class="example-wrap"><pre class="language-text"><code>&quot;./whatever.txt&quot;
&quot;./foo.html&quot;
&quot;./hello_world.rs&quot;</code></pre></div>
<p>The exact text, of course, depends on what files you have in <code>.</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.file_name" class="method"><a class="src rightside" href="../../src/tokio/fs/read_dir.rs.html#265-267">Source</a><h4 class="code-header">pub fn <a href="#method.file_name" class="fn">file_name</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.84.1/std/ffi/os_str/struct.OsString.html" title="struct std::ffi::os_str::OsString">OsString</a></h4></section></summary><div class="docblock"><p>Returns the bare file name of this directory entry without any other
leading path component.</p>
<h5 id="examples-2"><a class="doc-anchor" href="#examples-2">§</a>Examples</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::fs;
<span class="kw">let </span><span class="kw-2">mut </span>entries = fs::read_dir(<span class="string">"."</span>).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="kw">while let </span><span class="prelude-val">Some</span>(entry) = entries.next_entry().<span class="kw">await</span><span class="question-mark">? </span>{
<span class="macro">println!</span>(<span class="string">"{:?}"</span>, entry.file_name());
}</code></pre></div>
</div></details><details class="toggle method-toggle" open><summary><section id="method.metadata" class="method"><a class="src rightside" href="../../src/tokio/fs/read_dir.rs.html#299-302">Source</a><h4 class="code-header">pub async fn <a href="#method.metadata" class="fn">metadata</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/1.84.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/fs/struct.Metadata.html" title="struct std::fs::Metadata">Metadata</a>&gt;</h4></section></summary><div class="docblock"><p>Returns the metadata for the file that this entry points at.</p>
<p>This function will not traverse symlinks if this entry points at a
symlink.</p>
<h5 id="platform-specific-behavior"><a class="doc-anchor" href="#platform-specific-behavior">§</a>Platform-specific behavior</h5>
<p>On Windows this function is cheap to call (no extra system calls
needed), but on Unix platforms this function is the equivalent of
calling <code>symlink_metadata</code> on the path.</p>
<h5 id="examples-3"><a class="doc-anchor" href="#examples-3">§</a>Examples</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::fs;
<span class="kw">let </span><span class="kw-2">mut </span>entries = fs::read_dir(<span class="string">"."</span>).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="kw">while let </span><span class="prelude-val">Some</span>(entry) = entries.next_entry().<span class="kw">await</span><span class="question-mark">? </span>{
<span class="kw">if let </span><span class="prelude-val">Ok</span>(metadata) = entry.metadata().<span class="kw">await </span>{
<span class="comment">// Now let's show our entry's permissions!
</span><span class="macro">println!</span>(<span class="string">"{:?}: {:?}"</span>, entry.path(), metadata.permissions());
} <span class="kw">else </span>{
<span class="macro">println!</span>(<span class="string">"Couldn't get file type for {:?}"</span>, entry.path());
}
}</code></pre></div>
</div></details><details class="toggle method-toggle" open><summary><section id="method.file_type" class="method"><a class="src rightside" href="../../src/tokio/fs/read_dir.rs.html#334-350">Source</a><h4 class="code-header">pub async fn <a href="#method.file_type" class="fn">file_type</a>(&amp;self) -&gt; <a class="type" href="https://doc.rust-lang.org/1.84.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/fs/struct.FileType.html" title="struct std::fs::FileType">FileType</a>&gt;</h4></section></summary><div class="docblock"><p>Returns the file type for the file that this entry points at.</p>
<p>This function will not traverse symlinks if this entry points at a
symlink.</p>
<h5 id="platform-specific-behavior-1"><a class="doc-anchor" href="#platform-specific-behavior-1">§</a>Platform-specific behavior</h5>
<p>On Windows and most Unix platforms this function is free (no extra
system calls needed), but some Unix platforms may require the equivalent
call to <code>symlink_metadata</code> to learn about the target file type.</p>
<h5 id="examples-4"><a class="doc-anchor" href="#examples-4">§</a>Examples</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::fs;
<span class="kw">let </span><span class="kw-2">mut </span>entries = fs::read_dir(<span class="string">"."</span>).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="kw">while let </span><span class="prelude-val">Some</span>(entry) = entries.next_entry().<span class="kw">await</span><span class="question-mark">? </span>{
<span class="kw">if let </span><span class="prelude-val">Ok</span>(file_type) = entry.file_type().<span class="kw">await </span>{
<span class="comment">// Now let's show our entry's file type!
</span><span class="macro">println!</span>(<span class="string">"{:?}: {:?}"</span>, entry.path(), file_type);
} <span class="kw">else </span>{
<span class="macro">println!</span>(<span class="string">"Couldn't get file type for {:?}"</span>, entry.path());
}
}</code></pre></div>
</div></details></div></details></div><h2 id="trait-implementations" class="section-header">Trait Implementations<a href="#trait-implementations" class="anchor">§</a></h2><div id="trait-implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-Debug-for-DirEntry" class="impl"><a class="src rightside" href="../../src/tokio/fs/read_dir.rs.html#199">Source</a><a href="#impl-Debug-for-DirEntry" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="struct.DirEntry.html" title="struct tokio::fs::DirEntry">DirEntry</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl"><a class="src rightside" href="../../src/tokio/fs/read_dir.rs.html#199">Source</a><a href="#method.fmt" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/fmt/trait.Debug.html#tymethod.fmt" class="fn">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.84.1/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/1.84.1/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></section></summary><div class='docblock'>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/1.84.1/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></div></details></div></details></div><h2 id="synthetic-implementations" class="section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor">§</a></h2><div id="synthetic-implementations-list"><section id="impl-Freeze-for-DirEntry" class="impl"><a href="#impl-Freeze-for-DirEntry" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Freeze.html" title="trait core::marker::Freeze">Freeze</a> for <a class="struct" href="struct.DirEntry.html" title="struct tokio::fs::DirEntry">DirEntry</a></h3></section><section id="impl-RefUnwindSafe-for-DirEntry" class="impl"><a href="#impl-RefUnwindSafe-for-DirEntry" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.DirEntry.html" title="struct tokio::fs::DirEntry">DirEntry</a></h3></section><section id="impl-Send-for-DirEntry" class="impl"><a href="#impl-Send-for-DirEntry" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.DirEntry.html" title="struct tokio::fs::DirEntry">DirEntry</a></h3></section><section id="impl-Sync-for-DirEntry" class="impl"><a href="#impl-Sync-for-DirEntry" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.DirEntry.html" title="struct tokio::fs::DirEntry">DirEntry</a></h3></section><section id="impl-Unpin-for-DirEntry" class="impl"><a href="#impl-Unpin-for-DirEntry" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.DirEntry.html" title="struct tokio::fs::DirEntry">DirEntry</a></h3></section><section id="impl-UnwindSafe-for-DirEntry" class="impl"><a href="#impl-UnwindSafe-for-DirEntry" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.DirEntry.html" title="struct tokio::fs::DirEntry">DirEntry</a></h3></section></div><h2 id="blanket-implementations" class="section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor">§</a></h2><div id="blanket-implementations-list"><details class="toggle implementors-toggle"><summary><section id="impl-Any-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/any.rs.html#138">Source</a><a href="#impl-Any-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T<div class="where">where
T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/any.rs.html#139">Source</a><a href="#method.type_id" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/any/trait.Any.html#tymethod.type_id" class="fn">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.84.1/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></section></summary><div class='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.84.1/core/any/trait.Any.html#tymethod.type_id">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/borrow.rs.html#209">Source</a><a href="#impl-Borrow%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T<div class="where">where
T: ?<a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/borrow.rs.html#211">Source</a><a href="#method.borrow" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/borrow/trait.Borrow.html#tymethod.borrow" class="fn">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.reference.html">&amp;T</a></h4></section></summary><div class='docblock'>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.84.1/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/borrow.rs.html#217">Source</a><a href="#impl-BorrowMut%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T<div class="where">where
T: ?<a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/borrow.rs.html#218">Source</a><a href="#method.borrow_mut" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fn">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.reference.html">&amp;mut T</a></h4></section></summary><div class='docblock'>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.84.1/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-From%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#765">Source</a><a href="#impl-From%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#768">Source</a><a href="#method.from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(t: T) -&gt; T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#748-750">Source</a><a href="#impl-Into%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T<div class="where">where
U: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#758">Source</a><a href="#method.into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.Into.html#tymethod.into" class="fn">into</a>(self) -&gt; U</h4></section></summary><div class="docblock"><p>Calls <code>U::from(self)</code>.</p>
<p>That is, this conversion is whatever the implementation of
<code><a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for U</code> chooses to do.</p>
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#805-807">Source</a><a href="#impl-TryFrom%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T<div class="where">where
U: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-1" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#809">Source</a><a href="#associatedtype.Error-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#812">Source</a><a href="#method.try_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#790-792">Source</a><a href="#impl-TryInto%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T<div class="where">where
U: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#794">Source</a><a href="#associatedtype.Error" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#797">Source</a><a href="#method.try_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryInto.html#tymethod.try_into" class="fn">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details></div></section></div></main></body></html>

371
tokio/fs/struct.File.html Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,41 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Reads the entries in a directory."><title>ReadDir in tokio::fs - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="tokio" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tokio/index.html">tokio</a><span class="version">1.42.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">ReadDir</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#errors" title="Errors">Errors</a></li></ul><h3><a href="#implementations">Methods</a></h3><ul class="block method"><li><a href="#method.next_entry" title="next_entry">next_entry</a></li><li><a href="#method.poll_next_entry" title="poll_next_entry">poll_next_entry</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-Debug-for-ReadDir" title="Debug">Debug</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-RefUnwindSafe-for-ReadDir" title="!RefUnwindSafe">!RefUnwindSafe</a></li><li><a href="#impl-UnwindSafe-for-ReadDir" title="!UnwindSafe">!UnwindSafe</a></li><li><a href="#impl-Freeze-for-ReadDir" title="Freeze">Freeze</a></li><li><a href="#impl-Send-for-ReadDir" title="Send">Send</a></li><li><a href="#impl-Sync-for-ReadDir" title="Sync">Sync</a></li><li><a href="#impl-Unpin-for-ReadDir" title="Unpin">Unpin</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block blanket-implementation"><li><a href="#impl-Any-for-T" title="Any">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-T" title="Borrow&#60;T&#62;">Borrow&#60;T&#62;</a></li><li><a href="#impl-BorrowMut%3CT%3E-for-T" title="BorrowMut&#60;T&#62;">BorrowMut&#60;T&#62;</a></li><li><a href="#impl-From%3CT%3E-for-T" title="From&#60;T&#62;">From&#60;T&#62;</a></li><li><a href="#impl-Into%3CU%3E-for-T" title="Into&#60;U&#62;">Into&#60;U&#62;</a></li><li><a href="#impl-TryFrom%3CU%3E-for-T" title="TryFrom&#60;U&#62;">TryFrom&#60;U&#62;</a></li><li><a href="#impl-TryInto%3CU%3E-for-T" title="TryInto&#60;U&#62;">TryInto&#60;U&#62;</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>fs</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">tokio</a>::<wbr><a href="index.html">fs</a></span><h1>Struct <span class="struct">ReadDir</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/tokio/fs/read_dir.rs.html#64">Source</a> </span></div><pre class="rust item-decl"><code>pub struct ReadDir(<span class="comment">/* private fields */</span>);</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Reads the entries in a directory.</p>
<p>This struct is returned from the <a href="fn.read_dir.html" title="fn tokio::fs::read_dir"><code>read_dir</code></a> function of this module and
will yield instances of <a href="struct.DirEntry.html" title="struct tokio::fs::DirEntry"><code>DirEntry</code></a>. Through a <a href="struct.DirEntry.html" title="struct tokio::fs::DirEntry"><code>DirEntry</code></a> information
like the entrys path and possibly other metadata can be learned.</p>
<p>A <code>ReadDir</code> can be turned into a <code>Stream</code> with <a href="https://docs.rs/tokio-stream/0.1/tokio_stream/wrappers/struct.ReadDirStream.html"><code>ReadDirStream</code></a>.</p>
<h2 id="errors"><a class="doc-anchor" href="#errors">§</a>Errors</h2>
<p>This stream will return an <a href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html#variant.Err" title="variant core::result::Result::Err"><code>Err</code></a> if theres some sort of intermittent
IO error during iteration.</p>
</div></details><h2 id="implementations" class="section-header">Implementations<a href="#implementations" class="anchor">§</a></h2><div id="implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-ReadDir" class="impl"><a class="src rightside" href="../../src/tokio/fs/read_dir.rs.html#72-157">Source</a><a href="#impl-ReadDir" class="anchor">§</a><h3 class="code-header">impl <a class="struct" href="struct.ReadDir.html" title="struct tokio::fs::ReadDir">ReadDir</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.next_entry" class="method"><a class="src rightside" href="../../src/tokio/fs/read_dir.rs.html#78-81">Source</a><h4 class="code-header">pub async fn <a href="#method.next_entry" class="fn">next_entry</a>(&amp;mut self) -&gt; <a class="type" href="https://doc.rust-lang.org/1.84.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/1.84.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="struct.DirEntry.html" title="struct tokio::fs::DirEntry">DirEntry</a>&gt;&gt;</h4></section></summary><div class="docblock"><p>Returns the next entry in the directory stream.</p>
<h5 id="cancel-safety"><a class="doc-anchor" href="#cancel-safety">§</a>Cancel safety</h5>
<p>This method is cancellation safe.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.poll_next_entry" class="method"><a class="src rightside" href="../../src/tokio/fs/read_dir.rs.html#101-125">Source</a><h4 class="code-header">pub fn <a href="#method.poll_next_entry" class="fn">poll_next_entry</a>(
&amp;mut self,
cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.84.1/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="type" href="https://doc.rust-lang.org/1.84.1/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/1.84.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="struct.DirEntry.html" title="struct tokio::fs::DirEntry">DirEntry</a>&gt;&gt;&gt;</h4></section></summary><div class="docblock"><p>Polls for the next directory entry in the stream.</p>
<p>This method returns:</p>
<ul>
<li><code>Poll::Pending</code> if the next directory entry is not yet available.</li>
<li><code>Poll::Ready(Ok(Some(entry)))</code> if the next directory entry is available.</li>
<li><code>Poll::Ready(Ok(None))</code> if there are no more directory entries in this
stream.</li>
<li><code>Poll::Ready(Err(err))</code> if an IO error occurred while reading the next
directory entry.</li>
</ul>
<p>When the method returns <code>Poll::Pending</code>, the <code>Waker</code> in the provided
<code>Context</code> is scheduled to receive a wakeup when the next directory entry
becomes available on the underlying IO resource.</p>
<p>Note that on multiple calls to <code>poll_next_entry</code>, only the <code>Waker</code> from
the <code>Context</code> passed to the most recent call is scheduled to receive a
wakeup.</p>
</div></details></div></details></div><h2 id="trait-implementations" class="section-header">Trait Implementations<a href="#trait-implementations" class="anchor">§</a></h2><div id="trait-implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-Debug-for-ReadDir" class="impl"><a class="src rightside" href="../../src/tokio/fs/read_dir.rs.html#62">Source</a><a href="#impl-Debug-for-ReadDir" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="struct.ReadDir.html" title="struct tokio::fs::ReadDir">ReadDir</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl"><a class="src rightside" href="../../src/tokio/fs/read_dir.rs.html#62">Source</a><a href="#method.fmt" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/fmt/trait.Debug.html#tymethod.fmt" class="fn">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.84.1/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/1.84.1/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></section></summary><div class='docblock'>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/1.84.1/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></div></details></div></details></div><h2 id="synthetic-implementations" class="section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor">§</a></h2><div id="synthetic-implementations-list"><section id="impl-Freeze-for-ReadDir" class="impl"><a href="#impl-Freeze-for-ReadDir" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Freeze.html" title="trait core::marker::Freeze">Freeze</a> for <a class="struct" href="struct.ReadDir.html" title="struct tokio::fs::ReadDir">ReadDir</a></h3></section><section id="impl-RefUnwindSafe-for-ReadDir" class="impl"><a href="#impl-RefUnwindSafe-for-ReadDir" class="anchor">§</a><h3 class="code-header">impl !<a class="trait" href="https://doc.rust-lang.org/1.84.1/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.ReadDir.html" title="struct tokio::fs::ReadDir">ReadDir</a></h3></section><section id="impl-Send-for-ReadDir" class="impl"><a href="#impl-Send-for-ReadDir" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.ReadDir.html" title="struct tokio::fs::ReadDir">ReadDir</a></h3></section><section id="impl-Sync-for-ReadDir" class="impl"><a href="#impl-Sync-for-ReadDir" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.ReadDir.html" title="struct tokio::fs::ReadDir">ReadDir</a></h3></section><section id="impl-Unpin-for-ReadDir" class="impl"><a href="#impl-Unpin-for-ReadDir" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.ReadDir.html" title="struct tokio::fs::ReadDir">ReadDir</a></h3></section><section id="impl-UnwindSafe-for-ReadDir" class="impl"><a href="#impl-UnwindSafe-for-ReadDir" class="anchor">§</a><h3 class="code-header">impl !<a class="trait" href="https://doc.rust-lang.org/1.84.1/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.ReadDir.html" title="struct tokio::fs::ReadDir">ReadDir</a></h3></section></div><h2 id="blanket-implementations" class="section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor">§</a></h2><div id="blanket-implementations-list"><details class="toggle implementors-toggle"><summary><section id="impl-Any-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/any.rs.html#138">Source</a><a href="#impl-Any-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T<div class="where">where
T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/any.rs.html#139">Source</a><a href="#method.type_id" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/any/trait.Any.html#tymethod.type_id" class="fn">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.84.1/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></section></summary><div class='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.84.1/core/any/trait.Any.html#tymethod.type_id">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/borrow.rs.html#209">Source</a><a href="#impl-Borrow%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T<div class="where">where
T: ?<a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/borrow.rs.html#211">Source</a><a href="#method.borrow" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/borrow/trait.Borrow.html#tymethod.borrow" class="fn">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.reference.html">&amp;T</a></h4></section></summary><div class='docblock'>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.84.1/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/borrow.rs.html#217">Source</a><a href="#impl-BorrowMut%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T<div class="where">where
T: ?<a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/borrow.rs.html#218">Source</a><a href="#method.borrow_mut" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fn">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.reference.html">&amp;mut T</a></h4></section></summary><div class='docblock'>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.84.1/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-From%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#765">Source</a><a href="#impl-From%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#768">Source</a><a href="#method.from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(t: T) -&gt; T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#748-750">Source</a><a href="#impl-Into%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T<div class="where">where
U: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#758">Source</a><a href="#method.into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.Into.html#tymethod.into" class="fn">into</a>(self) -&gt; U</h4></section></summary><div class="docblock"><p>Calls <code>U::from(self)</code>.</p>
<p>That is, this conversion is whatever the implementation of
<code><a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for U</code> chooses to do.</p>
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#805-807">Source</a><a href="#impl-TryFrom%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T<div class="where">where
U: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-1" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#809">Source</a><a href="#associatedtype.Error-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#812">Source</a><a href="#method.try_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#790-792">Source</a><a href="#impl-TryInto%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T<div class="where">where
U: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#794">Source</a><a href="#associatedtype.Error" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#797">Source</a><a href="#method.try_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryInto.html#tymethod.try_into" class="fn">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details></div></section></div></main></body></html>

View file

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

View file

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

View file

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

View file

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