mirror of
https://github.com/NotAShelf/mpvrc.git
synced 2026-04-17 08:19:51 +00:00
285 lines
No EOL
118 KiB
HTML
285 lines
No EOL
118 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="A named temporary file."><title>NamedTempFile in tempfile - 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="tempfile" 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="icon" href="https://www.rust-lang.org/favicon.ico"></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><a class="logo-container" href="../tempfile/index.html"><img src="https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../tempfile/index.html"><img src="https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png" alt="logo"></a><h2><a href="../tempfile/index.html">tempfile</a><span class="version">3.14.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Named<wbr>Temp<wbr>File</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#security" title="Security">Security</a><ul><li><a href="#operating-system-specific-concerns" title="Operating System Specific Concerns">Operating System Specific Concerns</a></li></ul></li><li><a href="#resource-leaking" title="Resource Leaking">Resource Leaking</a></li></ul><h3><a href="#implementations">Methods</a></h3><ul class="block method"><li><a href="#method.as_file" title="as_file">as_file</a></li><li><a href="#method.as_file_mut" title="as_file_mut">as_file_mut</a></li><li><a href="#method.close" title="close">close</a></li><li><a href="#method.from_parts" title="from_parts">from_parts</a></li><li><a href="#method.into_file" title="into_file">into_file</a></li><li><a href="#method.into_parts" title="into_parts">into_parts</a></li><li><a href="#method.into_temp_path" title="into_temp_path">into_temp_path</a></li><li><a href="#method.keep" title="keep">keep</a></li><li><a href="#method.new" title="new">new</a></li><li><a href="#method.new_in" title="new_in">new_in</a></li><li><a href="#method.path" title="path">path</a></li><li><a href="#method.persist" title="persist">persist</a></li><li><a href="#method.persist_noclobber" title="persist_noclobber">persist_noclobber</a></li><li><a href="#method.reopen" title="reopen">reopen</a></li><li><a href="#method.with_prefix" title="with_prefix">with_prefix</a></li><li><a href="#method.with_prefix_in" title="with_prefix_in">with_prefix_in</a></li><li><a href="#method.with_suffix" title="with_suffix">with_suffix</a></li><li><a href="#method.with_suffix_in" title="with_suffix_in">with_suffix_in</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-AsFd-for-NamedTempFile%3CF%3E" title="AsFd">AsFd</a></li><li><a href="#impl-AsRawFd-for-NamedTempFile%3CF%3E" title="AsRawFd">AsRawFd</a></li><li><a href="#impl-AsRef%3CPath%3E-for-NamedTempFile%3CF%3E" title="AsRef<Path>">AsRef<Path></a></li><li><a href="#impl-Debug-for-NamedTempFile%3CF%3E" title="Debug">Debug</a></li><li><a href="#impl-From%3CPersistError%3CF%3E%3E-for-NamedTempFile%3CF%3E" title="From<PersistError<F>>">From<PersistError<F>></a></li><li><a href="#impl-Read-for-%26NamedTempFile" title="Read">Read</a></li><li><a href="#impl-Read-for-NamedTempFile%3CF%3E" title="Read">Read</a></li><li><a href="#impl-Seek-for-%26NamedTempFile" title="Seek">Seek</a></li><li><a href="#impl-Seek-for-NamedTempFile%3CF%3E" title="Seek">Seek</a></li><li><a href="#impl-Write-for-%26NamedTempFile" title="Write">Write</a></li><li><a href="#impl-Write-for-NamedTempFile%3CF%3E" title="Write">Write</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-Freeze-for-NamedTempFile%3CF%3E" title="Freeze">Freeze</a></li><li><a href="#impl-RefUnwindSafe-for-NamedTempFile%3CF%3E" title="RefUnwindSafe">RefUnwindSafe</a></li><li><a href="#impl-Send-for-NamedTempFile%3CF%3E" title="Send">Send</a></li><li><a href="#impl-Sync-for-NamedTempFile%3CF%3E" title="Sync">Sync</a></li><li><a href="#impl-Unpin-for-NamedTempFile%3CF%3E" title="Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe-for-NamedTempFile%3CF%3E" title="UnwindSafe">UnwindSafe</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block blanket-implementation"><li><a href="#impl-Any-for-T" title="Any">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-T" title="Borrow<T>">Borrow<T></a></li><li><a href="#impl-BorrowMut%3CT%3E-for-T" title="BorrowMut<T>">BorrowMut<T></a></li><li><a href="#impl-From%3CT%3E-for-T" title="From<T>">From<T></a></li><li><a href="#impl-Into%3CU%3E-for-T" title="Into<U>">Into<U></a></li><li><a href="#impl-TryFrom%3CU%3E-for-T" title="TryFrom<U>">TryFrom<U></a></li><li><a href="#impl-TryInto%3CU%3E-for-T" title="TryInto<U>">TryInto<U></a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate tempfile</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">tempfile</a></span><h1>Struct <span class="struct">NamedTempFile</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/tempfile/file/mod.rs.html#452-455">Source</a> </span></div><pre class="rust item-decl"><code>pub struct NamedTempFile<F = <a class="struct" href="https://doc.rust-lang.org/1.84.1/std/fs/struct.File.html" title="struct std::fs::File">File</a>> { <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>A named temporary file.</p>
|
||
<p>The default constructor, <a href="#method.new"><code>NamedTempFile::new()</code></a>, creates files in
|
||
the location returned by <a href="env/fn.temp_dir.html" title="fn tempfile::env::temp_dir"><code>env::temp_dir()</code></a>, but <code>NamedTempFile</code>
|
||
can be configured to manage a temporary file in any location
|
||
by constructing with <a href="#method.new_in"><code>NamedTempFile::new_in()</code></a>.</p>
|
||
<h2 id="security"><a class="doc-anchor" href="#security">§</a>Security</h2>
|
||
<p>Most operating systems employ temporary file cleaners to delete old
|
||
temporary files. Unfortunately these temporary file cleaners don’t always
|
||
reliably <em>detect</em> whether the temporary file is still being used.</p>
|
||
<p>Specifically, the following sequence of events can happen:</p>
|
||
<ol>
|
||
<li>A user creates a temporary file with <code>NamedTempFile::new()</code>.</li>
|
||
<li>Time passes.</li>
|
||
<li>The temporary file cleaner deletes (unlinks) the temporary file from the
|
||
filesystem.</li>
|
||
<li>Some other program creates a new file to replace this deleted temporary
|
||
file.</li>
|
||
<li>The user tries to re-open the temporary file (in the same program or in a
|
||
different program) by path. Unfortunately, they’ll end up opening the
|
||
file created by the other program, not the original file.</li>
|
||
</ol>
|
||
<h3 id="operating-system-specific-concerns"><a class="doc-anchor" href="#operating-system-specific-concerns">§</a>Operating System Specific Concerns</h3>
|
||
<p>The behavior of temporary files and temporary file cleaners differ by
|
||
operating system.</p>
|
||
<h4 id="windows"><a class="doc-anchor" href="#windows">§</a>Windows</h4>
|
||
<p>On Windows, open files <em>can’t</em> be deleted. This removes most of the concerns
|
||
around temporary file cleaners.</p>
|
||
<p>Furthermore, temporary files are, by default, created in per-user temporary
|
||
file directories so only an application running as the same user would be
|
||
able to interfere (which they could do anyways). However, an application
|
||
running as the same user can still <em>accidentally</em> re-create deleted
|
||
temporary files if the number of random bytes in the temporary file name is
|
||
too small.</p>
|
||
<p>So, the only real concern on Windows is:</p>
|
||
<ol>
|
||
<li>Opening a named temporary file in a world-writable directory.</li>
|
||
<li>Using the <code>into_temp_path()</code> and/or <code>into_parts()</code> APIs to close the file
|
||
handle without deleting the underlying file.</li>
|
||
<li>Continuing to use the file by path.</li>
|
||
</ol>
|
||
<h4 id="unix"><a class="doc-anchor" href="#unix">§</a>UNIX</h4>
|
||
<p>Unlike on Windows, UNIX (and UNIX like) systems allow open files to be
|
||
“unlinked” (deleted).</p>
|
||
<h5 id="macos"><a class="doc-anchor" href="#macos">§</a>MacOS</h5>
|
||
<p>Like on Windows, temporary files are created in per-user temporary file
|
||
directories by default so calling <code>NamedTempFile::new()</code> should be
|
||
relatively safe.</p>
|
||
<h5 id="linux"><a class="doc-anchor" href="#linux">§</a>Linux</h5>
|
||
<p>Unfortunately, most <em>Linux</em> distributions don’t create per-user temporary
|
||
file directories. Worse, systemd’s tmpfiles daemon (a common temporary file
|
||
cleaner) will happily remove open temporary files if they haven’t been
|
||
modified within the last 10 days.</p>
|
||
<h2 id="resource-leaking"><a class="doc-anchor" href="#resource-leaking">§</a>Resource Leaking</h2>
|
||
<p>If the program exits before the <code>NamedTempFile</code> destructor is
|
||
run, the temporary file will not be deleted. This can happen
|
||
if the process exits using <a href="http://doc.rust-lang.org/std/process/fn.exit.html"><code>std::process::exit()</code></a>, a segfault occurs,
|
||
receiving an interrupt signal like <code>SIGINT</code> that is not handled, or by using
|
||
a statically declared <code>NamedTempFile</code> instance (like with <a href="https://github.com/rust-lang-nursery/lazy-static.rs/issues/62"><code>lazy_static</code></a>).</p>
|
||
<p>Use the <a href="fn.tempfile.html"><code>tempfile()</code></a> function unless you need a named file path.</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-NamedTempFile" class="impl"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#510-633">Source</a><a href="#impl-NamedTempFile" class="anchor">§</a><h3 class="code-header">impl <a class="struct" href="struct.NamedTempFile.html" title="struct tempfile::NamedTempFile">NamedTempFile</a><<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/fs/struct.File.html" title="struct std::fs::File">File</a>></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.new" class="method"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#561-563">Source</a><h4 class="code-header">pub fn <a href="#method.new" class="fn">new</a>() -> <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><<a class="struct" href="struct.NamedTempFile.html" title="struct tempfile::NamedTempFile">NamedTempFile</a>></h4></section></summary><div class="docblock"><p>Create a new named temporary file.</p>
|
||
<p>See <a href="struct.Builder.html"><code>Builder</code></a> for more configuration.</p>
|
||
<h5 id="security-1"><a class="doc-anchor" href="#security-1">§</a>Security</h5>
|
||
<p>This will create a temporary file in the default temporary file
|
||
directory (platform dependent). This has security implications on many
|
||
platforms so please read the security section of this type’s
|
||
documentation.</p>
|
||
<p>Reasons to use this method:</p>
|
||
<ol>
|
||
<li>
|
||
<p>The file has a short lifetime and your temporary file cleaner is
|
||
sane (doesn’t delete recently accessed files).</p>
|
||
</li>
|
||
<li>
|
||
<p>You trust every user on your system (i.e. you are the only user).</p>
|
||
</li>
|
||
<li>
|
||
<p>You have disabled your system’s temporary file cleaner or verified
|
||
that your system doesn’t have a temporary file cleaner.</p>
|
||
</li>
|
||
</ol>
|
||
<p>Reasons not to use this method:</p>
|
||
<ol>
|
||
<li>
|
||
<p>You’ll fix it later. No you won’t.</p>
|
||
</li>
|
||
<li>
|
||
<p>You don’t care about the security of the temporary file. If none of
|
||
the “reasons to use this method” apply, referring to a temporary
|
||
file by name may allow an attacker to create/overwrite your
|
||
non-temporary files. There are exceptions but if you don’t already
|
||
know them, don’t use this method.</p>
|
||
</li>
|
||
</ol>
|
||
<h5 id="errors"><a class="doc-anchor" href="#errors">§</a>Errors</h5>
|
||
<p>If the file can not be created, <code>Err</code> is returned.</p>
|
||
<h5 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h5>
|
||
<p>Create a named temporary file and write some data to it:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::io::Write;
|
||
<span class="kw">use </span>tempfile::NamedTempFile;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>file = NamedTempFile::new()<span class="question-mark">?</span>;
|
||
|
||
<span class="macro">writeln!</span>(file, <span class="string">"Brian was here. Briefly."</span>)<span class="question-mark">?</span>;</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.new_in" class="method"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#576-578">Source</a><h4 class="code-header">pub fn <a href="#method.new_in" class="fn">new_in</a><P: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/path/struct.Path.html" title="struct std::path::Path">Path</a>>>(dir: P) -> <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><<a class="struct" href="struct.NamedTempFile.html" title="struct tempfile::NamedTempFile">NamedTempFile</a>></h4></section></summary><div class="docblock"><p>Create a new named temporary file in the specified directory.</p>
|
||
<p>This is equivalent to:</p>
|
||
|
||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code>Builder::new().tempfile_in(dir)</code></pre></div>
|
||
<p>See <a href="#method.new"><code>NamedTempFile::new()</code></a> for details.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.with_suffix" class="method"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#585-587">Source</a><h4 class="code-header">pub fn <a href="#method.with_suffix" class="fn">with_suffix</a><S: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/ffi/os_str/struct.OsStr.html" title="struct std::ffi::os_str::OsStr">OsStr</a>>>(suffix: S) -> <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><<a class="struct" href="struct.NamedTempFile.html" title="struct tempfile::NamedTempFile">NamedTempFile</a>></h4></section></summary><div class="docblock"><p>Create a new named temporary file with the specified filename suffix.</p>
|
||
<p>See <a href="#method.new"><code>NamedTempFile::new()</code></a> for details.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.with_suffix_in" class="method"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#600-605">Source</a><h4 class="code-header">pub fn <a href="#method.with_suffix_in" class="fn">with_suffix_in</a><S: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/ffi/os_str/struct.OsStr.html" title="struct std::ffi::os_str::OsStr">OsStr</a>>, P: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/path/struct.Path.html" title="struct std::path::Path">Path</a>>>(
|
||
suffix: S,
|
||
dir: P,
|
||
) -> <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><<a class="struct" href="struct.NamedTempFile.html" title="struct tempfile::NamedTempFile">NamedTempFile</a>></h4></section></summary><div class="docblock"><p>Create a new named temporary file with the specified filename suffix,
|
||
in the specified directory.</p>
|
||
<p>This is equivalent to:</p>
|
||
|
||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code>Builder::new().suffix(<span class="kw-2">&</span>suffix).tempfile_in(directory)</code></pre></div>
|
||
<p>See <a href="#method.new"><code>NamedTempFile::new()</code></a> for details.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.with_prefix" class="method"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#612-614">Source</a><h4 class="code-header">pub fn <a href="#method.with_prefix" class="fn">with_prefix</a><S: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/ffi/os_str/struct.OsStr.html" title="struct std::ffi::os_str::OsStr">OsStr</a>>>(prefix: S) -> <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><<a class="struct" href="struct.NamedTempFile.html" title="struct tempfile::NamedTempFile">NamedTempFile</a>></h4></section></summary><div class="docblock"><p>Create a new named temporary file with the specified filename prefix.</p>
|
||
<p>See <a href="#method.new"><code>NamedTempFile::new()</code></a> for details.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.with_prefix_in" class="method"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#627-632">Source</a><h4 class="code-header">pub fn <a href="#method.with_prefix_in" class="fn">with_prefix_in</a><S: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/ffi/os_str/struct.OsStr.html" title="struct std::ffi::os_str::OsStr">OsStr</a>>, P: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/path/struct.Path.html" title="struct std::path::Path">Path</a>>>(
|
||
prefix: S,
|
||
dir: P,
|
||
) -> <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><<a class="struct" href="struct.NamedTempFile.html" title="struct tempfile::NamedTempFile">NamedTempFile</a>></h4></section></summary><div class="docblock"><p>Create a new named temporary file with the specified filename prefix,
|
||
in the specified directory.</p>
|
||
<p>This is equivalent to:</p>
|
||
|
||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code>Builder::new().prefix(<span class="kw-2">&</span>prefix).tempfile_in(directory)</code></pre></div>
|
||
<p>See <a href="#method.new"><code>NamedTempFile::new()</code></a> for details.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-NamedTempFile%3CF%3E" class="impl"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#635-856">Source</a><a href="#impl-NamedTempFile%3CF%3E" class="anchor">§</a><h3 class="code-header">impl<F> <a class="struct" href="struct.NamedTempFile.html" title="struct tempfile::NamedTempFile">NamedTempFile</a><F></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/tempfile/file/mod.rs.html#655-657">Source</a><h4 class="code-header">pub fn <a href="#method.path" class="fn">path</a>(&self) -> &<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/path/struct.Path.html" title="struct std::path::Path">Path</a></h4></section></summary><div class="docblock"><p>Get the temporary file’s path.</p>
|
||
<h5 id="security-2"><a class="doc-anchor" href="#security-2">§</a>Security</h5>
|
||
<p>Referring to a temporary file’s path may not be secure in all cases.
|
||
Please read the security section on the top level documentation of this
|
||
type for details.</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>tempfile::NamedTempFile;
|
||
|
||
<span class="kw">let </span>file = NamedTempFile::new()<span class="question-mark">?</span>;
|
||
|
||
<span class="macro">println!</span>(<span class="string">"{:?}"</span>, file.path());</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.close" class="method"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#682-685">Source</a><h4 class="code-header">pub fn <a href="#method.close" class="fn">close</a>(self) -> <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><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</a>></h4></section></summary><div class="docblock"><p>Close and remove the temporary file.</p>
|
||
<p>Use this if you want to detect errors in deleting the file.</p>
|
||
<h5 id="errors-1"><a class="doc-anchor" href="#errors-1">§</a>Errors</h5>
|
||
<p>If the file cannot be deleted, <code>Err</code> is returned.</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>tempfile::NamedTempFile;
|
||
|
||
<span class="kw">let </span>file = NamedTempFile::new()<span class="question-mark">?</span>;
|
||
|
||
<span class="comment">// By closing the `NamedTempFile` explicitly, we can check that it has
|
||
// been deleted successfully. If we don't close it explicitly,
|
||
// the file will still be deleted when `file` goes out
|
||
// of scope, but we won't know whether deleting the file
|
||
// succeeded.
|
||
</span>file.close()<span class="question-mark">?</span>;</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.persist" class="method"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#722-734">Source</a><h4 class="code-header">pub fn <a href="#method.persist" class="fn">persist</a><P: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/path/struct.Path.html" title="struct std::path::Path">Path</a>>>(self, new_path: P) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><F, <a class="struct" href="struct.PersistError.html" title="struct tempfile::PersistError">PersistError</a><F>></h4></section></summary><div class="docblock"><p>Persist the temporary file at the target path.</p>
|
||
<p>If a file exists at the target path, persist will atomically replace it.
|
||
If this method fails, it will return <code>self</code> in the resulting
|
||
<a href="struct.PersistError.html"><code>PersistError</code></a>.</p>
|
||
<p>Note: Temporary files cannot be persisted across filesystems. Also
|
||
neither the file contents nor the containing directory are
|
||
synchronized, so the update may not yet have reached the disk when
|
||
<code>persist</code> returns.</p>
|
||
<h5 id="security-3"><a class="doc-anchor" href="#security-3">§</a>Security</h5>
|
||
<p>This method persists the temporary file using its path and may not be
|
||
secure in all cases. Please read the security section on the top
|
||
level documentation of this type for details.</p>
|
||
<h5 id="errors-2"><a class="doc-anchor" href="#errors-2">§</a>Errors</h5>
|
||
<p>If the file cannot be moved to the new location, <code>Err</code> is returned.</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>std::io::Write;
|
||
<span class="kw">use </span>tempfile::NamedTempFile;
|
||
|
||
<span class="kw">let </span>file = NamedTempFile::new()<span class="question-mark">?</span>;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>persisted_file = file.persist(<span class="string">"./saved_file.txt"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">writeln!</span>(persisted_file, <span class="string">"Brian was here. Briefly."</span>)<span class="question-mark">?</span>;</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.persist_noclobber" class="method"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#768-780">Source</a><h4 class="code-header">pub fn <a href="#method.persist_noclobber" class="fn">persist_noclobber</a><P: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/path/struct.Path.html" title="struct std::path::Path">Path</a>>>(
|
||
self,
|
||
new_path: P,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><F, <a class="struct" href="struct.PersistError.html" title="struct tempfile::PersistError">PersistError</a><F>></h4></section></summary><div class="docblock"><p>Persist the temporary file at the target path if and only if no file exists there.</p>
|
||
<p>If a file exists at the target path, fail. If this method fails, it will
|
||
return <code>self</code> in the resulting PersistError.</p>
|
||
<p>Note: Temporary files cannot be persisted across filesystems. Also Note:
|
||
This method is not atomic. It can leave the original link to the
|
||
temporary file behind.</p>
|
||
<h5 id="security-4"><a class="doc-anchor" href="#security-4">§</a>Security</h5>
|
||
<p>This method persists the temporary file using its path and may not be
|
||
secure in all cases. Please read the security section on the top
|
||
level documentation of this type for details.</p>
|
||
<h5 id="errors-3"><a class="doc-anchor" href="#errors-3">§</a>Errors</h5>
|
||
<p>If the file cannot be moved to the new location or a file already exists there,
|
||
<code>Err</code> is returned.</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>std::io::Write;
|
||
<span class="kw">use </span>tempfile::NamedTempFile;
|
||
|
||
<span class="kw">let </span>file = NamedTempFile::new()<span class="question-mark">?</span>;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>persisted_file = file.persist_noclobber(<span class="string">"./saved_file.txt"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">writeln!</span>(persisted_file, <span class="string">"Brian was here. Briefly."</span>)<span class="question-mark">?</span>;</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.keep" class="method"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#805-814">Source</a><h4 class="code-header">pub fn <a href="#method.keep" class="fn">keep</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><(F, <a class="struct" href="https://doc.rust-lang.org/1.84.1/std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>), <a class="struct" href="struct.PersistError.html" title="struct tempfile::PersistError">PersistError</a><F>></h4></section></summary><div class="docblock"><p>Keep the temporary file from being deleted. This function will turn the
|
||
temporary file into a non-temporary file without moving it.</p>
|
||
<h5 id="errors-4"><a class="doc-anchor" href="#errors-4">§</a>Errors</h5>
|
||
<p>On some platforms (e.g., Windows), we need to mark the file as
|
||
non-temporary. This operation could fail.</p>
|
||
<h5 id="examples-5"><a class="doc-anchor" href="#examples-5">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::io::Write;
|
||
<span class="kw">use </span>tempfile::NamedTempFile;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>file = NamedTempFile::new()<span class="question-mark">?</span>;
|
||
<span class="macro">writeln!</span>(file, <span class="string">"Brian was here. Briefly."</span>)<span class="question-mark">?</span>;
|
||
|
||
<span class="kw">let </span>(file, path) = file.keep()<span class="question-mark">?</span>;</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.as_file" class="method"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#817-819">Source</a><h4 class="code-header">pub fn <a href="#method.as_file" class="fn">as_file</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.reference.html">&F</a></h4></section></summary><div class="docblock"><p>Get a reference to the underlying file.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.as_file_mut" class="method"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#822-824">Source</a><h4 class="code-header">pub fn <a href="#method.as_file_mut" class="fn">as_file_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.reference.html">&mut F</a></h4></section></summary><div class="docblock"><p>Get a mutable reference to the underlying file.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.into_file" class="method"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#829-831">Source</a><h4 class="code-header">pub fn <a href="#method.into_file" class="fn">into_file</a>(self) -> F</h4></section></summary><div class="docblock"><p>Convert the temporary file into a <code>std::fs::File</code>.</p>
|
||
<p>The inner file will be deleted.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.into_temp_path" class="method"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#837-839">Source</a><h4 class="code-header">pub fn <a href="#method.into_temp_path" class="fn">into_temp_path</a>(self) -> <a class="struct" href="struct.TempPath.html" title="struct tempfile::TempPath">TempPath</a></h4></section></summary><div class="docblock"><p>Closes the file, leaving only the temporary file path.</p>
|
||
<p>This is useful when another process must be able to open the temporary
|
||
file.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.into_parts" class="method"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#845-847">Source</a><h4 class="code-header">pub fn <a href="#method.into_parts" class="fn">into_parts</a>(self) -> (F, <a class="struct" href="struct.TempPath.html" title="struct tempfile::TempPath">TempPath</a>)</h4></section></summary><div class="docblock"><p>Converts the named temporary file into its constituent parts.</p>
|
||
<p>Note: When the path is dropped, the file is deleted but the file handle
|
||
is still usable.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.from_parts" class="method"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#853-855">Source</a><h4 class="code-header">pub fn <a href="#method.from_parts" class="fn">from_parts</a>(file: F, path: <a class="struct" href="struct.TempPath.html" title="struct tempfile::TempPath">TempPath</a>) -> Self</h4></section></summary><div class="docblock"><p>Creates a <code>NamedTempFile</code> from its constituent parts.</p>
|
||
<p>This can be used with <a href="struct.NamedTempFile.html#method.into_parts" title="method tempfile::NamedTempFile::into_parts"><code>NamedTempFile::into_parts</code></a> to reconstruct the
|
||
<code>NamedTempFile</code>.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-NamedTempFile-1" class="impl"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#858-890">Source</a><a href="#impl-NamedTempFile-1" class="anchor">§</a><h3 class="code-header">impl <a class="struct" href="struct.NamedTempFile.html" title="struct tempfile::NamedTempFile">NamedTempFile</a><<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/fs/struct.File.html" title="struct std::fs::File">File</a>></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.reopen" class="method"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#886-889">Source</a><h4 class="code-header">pub fn <a href="#method.reopen" class="fn">reopen</a>(&self) -> <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><<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/fs/struct.File.html" title="struct std::fs::File">File</a>></h4></section></summary><div class="docblock"><p>Securely reopen the temporary file.</p>
|
||
<p>This function is useful when you need multiple independent handles to
|
||
the same file. It’s perfectly fine to drop the original <code>NamedTempFile</code>
|
||
while holding on to <code>File</code>s returned by this function; the <code>File</code>s will
|
||
remain usable. However, they may not be nameable.</p>
|
||
<h5 id="errors-5"><a class="doc-anchor" href="#errors-5">§</a>Errors</h5>
|
||
<p>If the file cannot be reopened, <code>Err</code> is returned.</p>
|
||
<h5 id="security-5"><a class="doc-anchor" href="#security-5">§</a>Security</h5>
|
||
<p>Unlike <code>File::open(my_temp_file.path())</code>, <code>NamedTempFile::reopen()</code>
|
||
guarantees that the re-opened file is the <em>same</em> file, even in the
|
||
presence of pathological temporary file cleaners.</p>
|
||
<h5 id="examples-6"><a class="doc-anchor" href="#examples-6">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tempfile::NamedTempFile;
|
||
|
||
<span class="kw">let </span>file = NamedTempFile::new()<span class="question-mark">?</span>;
|
||
|
||
<span class="kw">let </span>another_handle = file.reopen()<span class="question-mark">?</span>;</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-AsFd-for-NamedTempFile%3CF%3E" class="impl"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#1015-1019">Source</a><a href="#impl-AsFd-for-NamedTempFile%3CF%3E" class="anchor">§</a><h3 class="code-header">impl<F: <a class="trait" href="https://doc.rust-lang.org/1.84.1/std/os/fd/owned/trait.AsFd.html" title="trait std::os::fd::owned::AsFd">AsFd</a>> <a class="trait" href="https://doc.rust-lang.org/1.84.1/std/os/fd/owned/trait.AsFd.html" title="trait std::os::fd::owned::AsFd">AsFd</a> for <a class="struct" href="struct.NamedTempFile.html" title="struct tempfile::NamedTempFile">NamedTempFile</a><F></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.as_fd" class="method trait-impl"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#1016-1018">Source</a><a href="#method.as_fd" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/os/fd/owned/trait.AsFd.html#tymethod.as_fd" class="fn">as_fd</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/1.84.1/std/os/fd/owned/struct.BorrowedFd.html" title="struct std::os::fd::owned::BorrowedFd">BorrowedFd</a><'_></h4></section></summary><div class='docblock'>Borrows the file descriptor. <a href="https://doc.rust-lang.org/1.84.1/std/os/fd/owned/trait.AsFd.html#tymethod.as_fd">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-AsRawFd-for-NamedTempFile%3CF%3E" class="impl"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#1022-1027">Source</a><a href="#impl-AsRawFd-for-NamedTempFile%3CF%3E" class="anchor">§</a><h3 class="code-header">impl<F: <a class="trait" href="https://doc.rust-lang.org/1.84.1/std/os/fd/raw/trait.AsRawFd.html" title="trait std::os::fd::raw::AsRawFd">AsRawFd</a>> <a class="trait" href="https://doc.rust-lang.org/1.84.1/std/os/fd/raw/trait.AsRawFd.html" title="trait std::os::fd::raw::AsRawFd">AsRawFd</a> for <a class="struct" href="struct.NamedTempFile.html" title="struct tempfile::NamedTempFile">NamedTempFile</a><F></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.as_raw_fd" class="method trait-impl"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#1024-1026">Source</a><a href="#method.as_raw_fd" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/os/fd/raw/trait.AsRawFd.html#tymethod.as_raw_fd" class="fn">as_raw_fd</a>(&self) -> <a class="type" href="https://doc.rust-lang.org/1.84.1/std/os/fd/raw/type.RawFd.html" title="type std::os::fd::raw::RawFd">RawFd</a></h4></section></summary><div class='docblock'>Extracts the raw file descriptor. <a href="https://doc.rust-lang.org/1.84.1/std/os/fd/raw/trait.AsRawFd.html#tymethod.as_raw_fd">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-AsRef%3CPath%3E-for-NamedTempFile%3CF%3E" class="impl"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#463-468">Source</a><a href="#impl-AsRef%3CPath%3E-for-NamedTempFile%3CF%3E" class="anchor">§</a><h3 class="code-header">impl<F> <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/path/struct.Path.html" title="struct std::path::Path">Path</a>> for <a class="struct" href="struct.NamedTempFile.html" title="struct tempfile::NamedTempFile">NamedTempFile</a><F></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.as_ref" class="method trait-impl"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#465-467">Source</a><a href="#method.as_ref" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html#tymethod.as_ref" class="fn">as_ref</a>(&self) -> &<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/path/struct.Path.html" title="struct std::path::Path">Path</a></h4></section></summary><div class='docblock'>Converts this type into a shared reference of the (usually inferred) input type.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Debug-for-NamedTempFile%3CF%3E" class="impl"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#457-461">Source</a><a href="#impl-Debug-for-NamedTempFile%3CF%3E" class="anchor">§</a><h3 class="code-header">impl<F> <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.NamedTempFile.html" title="struct tempfile::NamedTempFile">NamedTempFile</a><F></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/tempfile/file/mod.rs.html#458-460">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>(&self, f: &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><'_>) -> <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><details class="toggle implementors-toggle" open><summary><section id="impl-From%3CPersistError%3CF%3E%3E-for-NamedTempFile%3CF%3E" class="impl"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#491-496">Source</a><a href="#impl-From%3CPersistError%3CF%3E%3E-for-NamedTempFile%3CF%3E" class="anchor">§</a><h3 class="code-header">impl<F> <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="struct.PersistError.html" title="struct tempfile::PersistError">PersistError</a><F>> for <a class="struct" href="struct.NamedTempFile.html" title="struct tempfile::NamedTempFile">NamedTempFile</a><F></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="../src/tempfile/file/mod.rs.html#493-495">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>(error: <a class="struct" href="struct.PersistError.html" title="struct tempfile::PersistError">PersistError</a><F>) -> <a class="struct" href="struct.NamedTempFile.html" title="struct tempfile::NamedTempFile">NamedTempFile</a><F> <a href="#" class="tooltip" data-notable-ty="NamedTempFile<F>">ⓘ</a></h4></section></summary><div class='docblock'>Converts to this type from the input type.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Read-for-%26NamedTempFile" class="impl"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#922-948">Source</a><a href="#impl-Read-for-%26NamedTempFile" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html" title="trait std::io::Read">Read</a> for &<a class="struct" href="struct.NamedTempFile.html" title="struct tempfile::NamedTempFile">NamedTempFile</a><<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/fs/struct.File.html" title="struct std::fs::File">File</a>></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.read-1" class="method trait-impl"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#923-925">Source</a><a href="#method.read-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#tymethod.read" class="fn">read</a>(&mut self, buf: &mut [<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u8.html">u8</a>]) -> <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><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.usize.html">usize</a>></h4></section></summary><div class='docblock'>Pull some bytes from this source into the specified buffer, returning
|
||
how many bytes were read. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#tymethod.read">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.read_vectored-1" class="method trait-impl"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#927-931">Source</a><a href="#method.read_vectored-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.read_vectored" class="fn">read_vectored</a>(&mut self, bufs: &mut [<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/io/struct.IoSliceMut.html" title="struct std::io::IoSliceMut">IoSliceMut</a><'_>]) -> <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><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.usize.html">usize</a>></h4></section></summary><div class='docblock'>Like <code>read</code>, except that it reads into a slice of buffers. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.read_vectored">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.read_to_end-1" class="method trait-impl"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#933-937">Source</a><a href="#method.read_to_end-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.read_to_end" class="fn">read_to_end</a>(&mut self, buf: &mut <a class="struct" href="https://doc.rust-lang.org/1.84.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u8.html">u8</a>>) -> <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><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.usize.html">usize</a>></h4></section></summary><div class='docblock'>Reads all bytes until EOF in this source, placing them into <code>buf</code>. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.read_to_end">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.read_to_string-1" class="method trait-impl"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#939-943">Source</a><a href="#method.read_to_string-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.read_to_string" class="fn">read_to_string</a>(&mut self, buf: &mut <a class="struct" href="https://doc.rust-lang.org/1.84.1/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>) -> <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><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.usize.html">usize</a>></h4></section></summary><div class='docblock'>Reads all bytes until EOF in this source, appending them to <code>buf</code>. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.read_to_string">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.read_exact-1" class="method trait-impl"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#945-947">Source</a><a href="#method.read_exact-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.read_exact" class="fn">read_exact</a>(&mut self, buf: &mut [<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u8.html">u8</a>]) -> <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><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</a>></h4></section></summary><div class='docblock'>Reads the exact number of bytes required to fill <code>buf</code>. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.read_exact">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.is_read_vectored-1" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/std/io/mod.rs.html#791">Source</a><a href="#method.is_read_vectored-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.is_read_vectored" class="fn">is_read_vectored</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.bool.html">bool</a></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>can_vector</code>)</span></div></span><div class='docblock'>Determines if this <code>Read</code>er has an efficient <code>read_vectored</code>
|
||
implementation. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.is_read_vectored">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.read_buf-1" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/std/io/mod.rs.html#984">Source</a><a href="#method.read_buf-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.read_buf" class="fn">read_buf</a>(&mut self, buf: <a class="struct" href="https://doc.rust-lang.org/1.84.1/core/io/borrowed_buf/struct.BorrowedCursor.html" title="struct core::io::borrowed_buf::BorrowedCursor">BorrowedCursor</a><'_>) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</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>></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>read_buf</code>)</span></div></span><div class='docblock'>Pull some bytes from this source into the specified buffer. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.read_buf">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.read_buf_exact-1" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/std/io/mod.rs.html#1007">Source</a><a href="#method.read_buf_exact-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.read_buf_exact" class="fn">read_buf_exact</a>(&mut self, cursor: <a class="struct" href="https://doc.rust-lang.org/1.84.1/core/io/borrowed_buf/struct.BorrowedCursor.html" title="struct core::io::borrowed_buf::BorrowedCursor">BorrowedCursor</a><'_>) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</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>></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>read_buf</code>)</span></div></span><div class='docblock'>Reads the exact number of bytes required to fill <code>cursor</code>. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.read_buf_exact">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.by_ref-1" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.84.1/src/std/io/mod.rs.html#1046-1048">Source</a></span><a href="#method.by_ref-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.by_ref" class="fn">by_ref</a>(&mut self) -> &mut Self<div class="where">where
|
||
Self: <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></h4></section></summary><div class='docblock'>Creates a “by reference” adaptor for this instance of <code>Read</code>. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.by_ref">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.bytes-1" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.84.1/src/std/io/mod.rs.html#1089-1091">Source</a></span><a href="#method.bytes-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.bytes" class="fn">bytes</a>(self) -> <a class="struct" href="https://doc.rust-lang.org/1.84.1/std/io/struct.Bytes.html" title="struct std::io::Bytes">Bytes</a><Self><div class="where">where
|
||
Self: <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></h4></section></summary><div class='docblock'>Transforms this <code>Read</code> instance to an <a href="https://doc.rust-lang.org/1.84.1/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator"><code>Iterator</code></a> over its bytes. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.bytes">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.chain-1" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.84.1/src/std/io/mod.rs.html#1127-1129">Source</a></span><a href="#method.chain-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.chain" class="fn">chain</a><R>(self, next: R) -> <a class="struct" href="https://doc.rust-lang.org/1.84.1/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><Self, R><div class="where">where
|
||
R: <a class="trait" href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html" title="trait std::io::Read">Read</a>,
|
||
Self: <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></h4></section></summary><div class='docblock'>Creates an adapter which will chain this stream with another. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.chain">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.take-1" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.84.1/src/std/io/mod.rs.html#1166-1168">Source</a></span><a href="#method.take-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.take" class="fn">take</a>(self, limit: <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/struct.Take.html" title="struct std::io::Take">Take</a><Self><div class="where">where
|
||
Self: <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></h4></section></summary><div class='docblock'>Creates an adapter which will read at most <code>limit</code> bytes from it. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.take">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Read-for-NamedTempFile%3CF%3E" class="impl"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#892-920">Source</a><a href="#impl-Read-for-NamedTempFile%3CF%3E" class="anchor">§</a><h3 class="code-header">impl<F: <a class="trait" href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html" title="trait std::io::Read">Read</a>> <a class="trait" href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html" title="trait std::io::Read">Read</a> for <a class="struct" href="struct.NamedTempFile.html" title="struct tempfile::NamedTempFile">NamedTempFile</a><F></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.read" class="method trait-impl"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#893-895">Source</a><a href="#method.read" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#tymethod.read" class="fn">read</a>(&mut self, buf: &mut [<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u8.html">u8</a>]) -> <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><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.usize.html">usize</a>></h4></section></summary><div class='docblock'>Pull some bytes from this source into the specified buffer, returning
|
||
how many bytes were read. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#tymethod.read">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.read_vectored" class="method trait-impl"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#897-901">Source</a><a href="#method.read_vectored" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.read_vectored" class="fn">read_vectored</a>(&mut self, bufs: &mut [<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/io/struct.IoSliceMut.html" title="struct std::io::IoSliceMut">IoSliceMut</a><'_>]) -> <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><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.usize.html">usize</a>></h4></section></summary><div class='docblock'>Like <code>read</code>, except that it reads into a slice of buffers. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.read_vectored">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.read_to_end" class="method trait-impl"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#903-907">Source</a><a href="#method.read_to_end" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.read_to_end" class="fn">read_to_end</a>(&mut self, buf: &mut <a class="struct" href="https://doc.rust-lang.org/1.84.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u8.html">u8</a>>) -> <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><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.usize.html">usize</a>></h4></section></summary><div class='docblock'>Reads all bytes until EOF in this source, placing them into <code>buf</code>. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.read_to_end">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.read_to_string" class="method trait-impl"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#909-913">Source</a><a href="#method.read_to_string" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.read_to_string" class="fn">read_to_string</a>(&mut self, buf: &mut <a class="struct" href="https://doc.rust-lang.org/1.84.1/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>) -> <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><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.usize.html">usize</a>></h4></section></summary><div class='docblock'>Reads all bytes until EOF in this source, appending them to <code>buf</code>. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.read_to_string">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.read_exact" class="method trait-impl"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#915-919">Source</a><a href="#method.read_exact" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.read_exact" class="fn">read_exact</a>(&mut self, buf: &mut [<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u8.html">u8</a>]) -> <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><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</a>></h4></section></summary><div class='docblock'>Reads the exact number of bytes required to fill <code>buf</code>. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.read_exact">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.is_read_vectored" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/std/io/mod.rs.html#791">Source</a><a href="#method.is_read_vectored" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.is_read_vectored" class="fn">is_read_vectored</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.bool.html">bool</a></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>can_vector</code>)</span></div></span><div class='docblock'>Determines if this <code>Read</code>er has an efficient <code>read_vectored</code>
|
||
implementation. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.is_read_vectored">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.read_buf" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/std/io/mod.rs.html#984">Source</a><a href="#method.read_buf" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.read_buf" class="fn">read_buf</a>(&mut self, buf: <a class="struct" href="https://doc.rust-lang.org/1.84.1/core/io/borrowed_buf/struct.BorrowedCursor.html" title="struct core::io::borrowed_buf::BorrowedCursor">BorrowedCursor</a><'_>) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</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>></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>read_buf</code>)</span></div></span><div class='docblock'>Pull some bytes from this source into the specified buffer. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.read_buf">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.read_buf_exact" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/std/io/mod.rs.html#1007">Source</a><a href="#method.read_buf_exact" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.read_buf_exact" class="fn">read_buf_exact</a>(&mut self, cursor: <a class="struct" href="https://doc.rust-lang.org/1.84.1/core/io/borrowed_buf/struct.BorrowedCursor.html" title="struct core::io::borrowed_buf::BorrowedCursor">BorrowedCursor</a><'_>) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</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>></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>read_buf</code>)</span></div></span><div class='docblock'>Reads the exact number of bytes required to fill <code>cursor</code>. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.read_buf_exact">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.by_ref" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.84.1/src/std/io/mod.rs.html#1046-1048">Source</a></span><a href="#method.by_ref" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.by_ref" class="fn">by_ref</a>(&mut self) -> &mut Self<div class="where">where
|
||
Self: <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></h4></section></summary><div class='docblock'>Creates a “by reference” adaptor for this instance of <code>Read</code>. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.by_ref">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.bytes" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.84.1/src/std/io/mod.rs.html#1089-1091">Source</a></span><a href="#method.bytes" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.bytes" class="fn">bytes</a>(self) -> <a class="struct" href="https://doc.rust-lang.org/1.84.1/std/io/struct.Bytes.html" title="struct std::io::Bytes">Bytes</a><Self><div class="where">where
|
||
Self: <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></h4></section></summary><div class='docblock'>Transforms this <code>Read</code> instance to an <a href="https://doc.rust-lang.org/1.84.1/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator"><code>Iterator</code></a> over its bytes. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.bytes">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.chain" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.84.1/src/std/io/mod.rs.html#1127-1129">Source</a></span><a href="#method.chain" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.chain" class="fn">chain</a><R>(self, next: R) -> <a class="struct" href="https://doc.rust-lang.org/1.84.1/std/io/struct.Chain.html" title="struct std::io::Chain">Chain</a><Self, R><div class="where">where
|
||
R: <a class="trait" href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html" title="trait std::io::Read">Read</a>,
|
||
Self: <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></h4></section></summary><div class='docblock'>Creates an adapter which will chain this stream with another. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.chain">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.take" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.84.1/src/std/io/mod.rs.html#1166-1168">Source</a></span><a href="#method.take" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.take" class="fn">take</a>(self, limit: <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/struct.Take.html" title="struct std::io::Take">Take</a><Self><div class="where">where
|
||
Self: <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></h4></section></summary><div class='docblock'>Creates an adapter which will read at most <code>limit</code> bytes from it. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html#method.take">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Seek-for-%26NamedTempFile" class="impl"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#1008-1012">Source</a><a href="#impl-Seek-for-%26NamedTempFile" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/std/io/trait.Seek.html" title="trait std::io::Seek">Seek</a> for &<a class="struct" href="struct.NamedTempFile.html" title="struct tempfile::NamedTempFile">NamedTempFile</a><<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/fs/struct.File.html" title="struct std::fs::File">File</a>></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.seek-1" class="method trait-impl"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#1009-1011">Source</a><a href="#method.seek-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Seek.html#tymethod.seek" class="fn">seek</a>(&mut self, pos: <a class="enum" href="https://doc.rust-lang.org/1.84.1/std/io/enum.SeekFrom.html" title="enum std::io::SeekFrom">SeekFrom</a>) -> <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><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u64.html">u64</a>></h4></section></summary><div class='docblock'>Seek to an offset, in bytes, in a stream. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Seek.html#tymethod.seek">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.rewind-1" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.55.0">1.55.0</span> · <a class="src" href="https://doc.rust-lang.org/1.84.1/src/std/io/mod.rs.html#2006">Source</a></span><a href="#method.rewind-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Seek.html#method.rewind" class="fn">rewind</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</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>></h4></section></summary><div class='docblock'>Rewind to the beginning of a stream. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Seek.html#method.rewind">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.stream_len-1" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/std/io/mod.rs.html#2046">Source</a><a href="#method.stream_len-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Seek.html#method.stream_len" class="fn">stream_len</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<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>></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>seek_stream_len</code>)</span></div></span><div class='docblock'>Returns the length of this stream (in bytes). <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Seek.html#method.stream_len">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.stream_position-1" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.51.0">1.51.0</span> · <a class="src" href="https://doc.rust-lang.org/1.84.1/src/std/io/mod.rs.html#2083">Source</a></span><a href="#method.stream_position-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Seek.html#method.stream_position" class="fn">stream_position</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<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>></h4></section></summary><div class='docblock'>Returns the current seek position from the start of the stream. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Seek.html#method.stream_position">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.seek_relative-1" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.80.0">1.80.0</span> · <a class="src" href="https://doc.rust-lang.org/1.84.1/src/std/io/mod.rs.html#2111">Source</a></span><a href="#method.seek_relative-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Seek.html#method.seek_relative" class="fn">seek_relative</a>(&mut self, offset: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.i64.html">i64</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</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>></h4></section></summary><div class='docblock'>Seeks relative to the current position. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Seek.html#method.seek_relative">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Seek-for-NamedTempFile%3CF%3E" class="impl"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#1002-1006">Source</a><a href="#impl-Seek-for-NamedTempFile%3CF%3E" class="anchor">§</a><h3 class="code-header">impl<F: <a class="trait" href="https://doc.rust-lang.org/1.84.1/std/io/trait.Seek.html" title="trait std::io::Seek">Seek</a>> <a class="trait" href="https://doc.rust-lang.org/1.84.1/std/io/trait.Seek.html" title="trait std::io::Seek">Seek</a> for <a class="struct" href="struct.NamedTempFile.html" title="struct tempfile::NamedTempFile">NamedTempFile</a><F></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.seek" class="method trait-impl"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#1003-1005">Source</a><a href="#method.seek" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Seek.html#tymethod.seek" class="fn">seek</a>(&mut self, pos: <a class="enum" href="https://doc.rust-lang.org/1.84.1/std/io/enum.SeekFrom.html" title="enum std::io::SeekFrom">SeekFrom</a>) -> <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><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u64.html">u64</a>></h4></section></summary><div class='docblock'>Seek to an offset, in bytes, in a stream. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Seek.html#tymethod.seek">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.rewind" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.55.0">1.55.0</span> · <a class="src" href="https://doc.rust-lang.org/1.84.1/src/std/io/mod.rs.html#2006">Source</a></span><a href="#method.rewind" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Seek.html#method.rewind" class="fn">rewind</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</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>></h4></section></summary><div class='docblock'>Rewind to the beginning of a stream. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Seek.html#method.rewind">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.stream_len" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/std/io/mod.rs.html#2046">Source</a><a href="#method.stream_len" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Seek.html#method.stream_len" class="fn">stream_len</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<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>></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>seek_stream_len</code>)</span></div></span><div class='docblock'>Returns the length of this stream (in bytes). <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Seek.html#method.stream_len">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.stream_position" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.51.0">1.51.0</span> · <a class="src" href="https://doc.rust-lang.org/1.84.1/src/std/io/mod.rs.html#2083">Source</a></span><a href="#method.stream_position" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Seek.html#method.stream_position" class="fn">stream_position</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<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>></h4></section></summary><div class='docblock'>Returns the current seek position from the start of the stream. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Seek.html#method.stream_position">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.seek_relative" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.80.0">1.80.0</span> · <a class="src" href="https://doc.rust-lang.org/1.84.1/src/std/io/mod.rs.html#2111">Source</a></span><a href="#method.seek_relative" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Seek.html#method.seek_relative" class="fn">seek_relative</a>(&mut self, offset: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.i64.html">i64</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</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>></h4></section></summary><div class='docblock'>Seeks relative to the current position. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Seek.html#method.seek_relative">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Write-for-%26NamedTempFile" class="impl"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#978-1000">Source</a><a href="#impl-Write-for-%26NamedTempFile" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html" title="trait std::io::Write">Write</a> for &<a class="struct" href="struct.NamedTempFile.html" title="struct tempfile::NamedTempFile">NamedTempFile</a><<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/fs/struct.File.html" title="struct std::fs::File">File</a>></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.write-1" class="method trait-impl"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#979-981">Source</a><a href="#method.write-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html#tymethod.write" class="fn">write</a>(&mut self, buf: &[<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u8.html">u8</a>]) -> <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><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.usize.html">usize</a>></h4></section></summary><div class='docblock'>Writes a buffer into this writer, returning how many bytes were written. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html#tymethod.write">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.flush-1" class="method trait-impl"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#983-985">Source</a><a href="#method.flush-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html#tymethod.flush" class="fn">flush</a>(&mut self) -> <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><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</a>></h4></section></summary><div class='docblock'>Flushes this output stream, ensuring that all intermediately buffered
|
||
contents reach their destination. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html#tymethod.flush">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.write_vectored-1" class="method trait-impl"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#987-991">Source</a><a href="#method.write_vectored-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html#method.write_vectored" class="fn">write_vectored</a>(&mut self, bufs: &[<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/io/struct.IoSlice.html" title="struct std::io::IoSlice">IoSlice</a><'_>]) -> <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><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.usize.html">usize</a>></h4></section></summary><div class='docblock'>Like <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html#tymethod.write" title="method std::io::Write::write"><code>write</code></a>, except that it writes from a slice of buffers. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html#method.write_vectored">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.write_all-1" class="method trait-impl"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#993-995">Source</a><a href="#method.write_all-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html#method.write_all" class="fn">write_all</a>(&mut self, buf: &[<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u8.html">u8</a>]) -> <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><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</a>></h4></section></summary><div class='docblock'>Attempts to write an entire buffer into this writer. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html#method.write_all">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.write_fmt-1" class="method trait-impl"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#997-999">Source</a><a href="#method.write_fmt-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html#method.write_fmt" class="fn">write_fmt</a>(&mut self, fmt: <a class="struct" href="https://doc.rust-lang.org/1.84.1/core/fmt/struct.Arguments.html" title="struct core::fmt::Arguments">Arguments</a><'_>) -> <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><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</a>></h4></section></summary><div class='docblock'>Writes a formatted string into this writer, returning any error
|
||
encountered. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html#method.write_fmt">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.is_write_vectored-1" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/std/io/mod.rs.html#1686">Source</a><a href="#method.is_write_vectored-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html#method.is_write_vectored" class="fn">is_write_vectored</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.bool.html">bool</a></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>can_vector</code>)</span></div></span><div class='docblock'>Determines if this <code>Write</code>r has an efficient <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html#method.write_vectored" title="method std::io::Write::write_vectored"><code>write_vectored</code></a>
|
||
implementation. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html#method.is_write_vectored">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.write_all_vectored-1" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/std/io/mod.rs.html#1810">Source</a><a href="#method.write_all_vectored-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html#method.write_all_vectored" class="fn">write_all_vectored</a>(&mut self, bufs: &mut [<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/io/struct.IoSlice.html" title="struct std::io::IoSlice">IoSlice</a><'_>]) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</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>></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>write_all_vectored</code>)</span></div></span><div class='docblock'>Attempts to write multiple buffers into this writer. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html#method.write_all_vectored">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.by_ref-3" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.84.1/src/std/io/mod.rs.html#1923-1925">Source</a></span><a href="#method.by_ref-3" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html#method.by_ref" class="fn">by_ref</a>(&mut self) -> &mut Self<div class="where">where
|
||
Self: <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></h4></section></summary><div class='docblock'>Creates a “by reference” adapter for this instance of <code>Write</code>. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html#method.by_ref">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Write-for-NamedTempFile%3CF%3E" class="impl"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#950-976">Source</a><a href="#impl-Write-for-NamedTempFile%3CF%3E" class="anchor">§</a><h3 class="code-header">impl<F: <a class="trait" href="https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html" title="trait std::io::Write">Write</a>> <a class="trait" href="https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html" title="trait std::io::Write">Write</a> for <a class="struct" href="struct.NamedTempFile.html" title="struct tempfile::NamedTempFile">NamedTempFile</a><F></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.write" class="method trait-impl"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#951-953">Source</a><a href="#method.write" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html#tymethod.write" class="fn">write</a>(&mut self, buf: &[<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u8.html">u8</a>]) -> <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><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.usize.html">usize</a>></h4></section></summary><div class='docblock'>Writes a buffer into this writer, returning how many bytes were written. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html#tymethod.write">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.flush" class="method trait-impl"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#955-957">Source</a><a href="#method.flush" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html#tymethod.flush" class="fn">flush</a>(&mut self) -> <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><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</a>></h4></section></summary><div class='docblock'>Flushes this output stream, ensuring that all intermediately buffered
|
||
contents reach their destination. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html#tymethod.flush">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.write_vectored" class="method trait-impl"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#959-963">Source</a><a href="#method.write_vectored" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html#method.write_vectored" class="fn">write_vectored</a>(&mut self, bufs: &[<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/io/struct.IoSlice.html" title="struct std::io::IoSlice">IoSlice</a><'_>]) -> <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><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.usize.html">usize</a>></h4></section></summary><div class='docblock'>Like <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html#tymethod.write" title="method std::io::Write::write"><code>write</code></a>, except that it writes from a slice of buffers. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html#method.write_vectored">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.write_all" class="method trait-impl"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#965-969">Source</a><a href="#method.write_all" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html#method.write_all" class="fn">write_all</a>(&mut self, buf: &[<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u8.html">u8</a>]) -> <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><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</a>></h4></section></summary><div class='docblock'>Attempts to write an entire buffer into this writer. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html#method.write_all">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.write_fmt" class="method trait-impl"><a class="src rightside" href="../src/tempfile/file/mod.rs.html#971-975">Source</a><a href="#method.write_fmt" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html#method.write_fmt" class="fn">write_fmt</a>(&mut self, fmt: <a class="struct" href="https://doc.rust-lang.org/1.84.1/core/fmt/struct.Arguments.html" title="struct core::fmt::Arguments">Arguments</a><'_>) -> <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><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</a>></h4></section></summary><div class='docblock'>Writes a formatted string into this writer, returning any error
|
||
encountered. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html#method.write_fmt">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.is_write_vectored" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/std/io/mod.rs.html#1686">Source</a><a href="#method.is_write_vectored" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html#method.is_write_vectored" class="fn">is_write_vectored</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.bool.html">bool</a></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>can_vector</code>)</span></div></span><div class='docblock'>Determines if this <code>Write</code>r has an efficient <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html#method.write_vectored" title="method std::io::Write::write_vectored"><code>write_vectored</code></a>
|
||
implementation. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html#method.is_write_vectored">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.write_all_vectored" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/std/io/mod.rs.html#1810">Source</a><a href="#method.write_all_vectored" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html#method.write_all_vectored" class="fn">write_all_vectored</a>(&mut self, bufs: &mut [<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/io/struct.IoSlice.html" title="struct std::io::IoSlice">IoSlice</a><'_>]) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</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>></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>write_all_vectored</code>)</span></div></span><div class='docblock'>Attempts to write multiple buffers into this writer. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html#method.write_all_vectored">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.by_ref-2" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.84.1/src/std/io/mod.rs.html#1923-1925">Source</a></span><a href="#method.by_ref-2" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html#method.by_ref" class="fn">by_ref</a>(&mut self) -> &mut Self<div class="where">where
|
||
Self: <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></h4></section></summary><div class='docblock'>Creates a “by reference” adapter for this instance of <code>Write</code>. <a href="https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html#method.by_ref">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-NamedTempFile%3CF%3E" class="impl"><a href="#impl-Freeze-for-NamedTempFile%3CF%3E" class="anchor">§</a><h3 class="code-header">impl<F> <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.NamedTempFile.html" title="struct tempfile::NamedTempFile">NamedTempFile</a><F><div class="where">where
|
||
F: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Freeze.html" title="trait core::marker::Freeze">Freeze</a>,</div></h3></section><section id="impl-RefUnwindSafe-for-NamedTempFile%3CF%3E" class="impl"><a href="#impl-RefUnwindSafe-for-NamedTempFile%3CF%3E" class="anchor">§</a><h3 class="code-header">impl<F> <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.NamedTempFile.html" title="struct tempfile::NamedTempFile">NamedTempFile</a><F><div class="where">where
|
||
F: <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>,</div></h3></section><section id="impl-Send-for-NamedTempFile%3CF%3E" class="impl"><a href="#impl-Send-for-NamedTempFile%3CF%3E" class="anchor">§</a><h3 class="code-header">impl<F> <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.NamedTempFile.html" title="struct tempfile::NamedTempFile">NamedTempFile</a><F><div class="where">where
|
||
F: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,</div></h3></section><section id="impl-Sync-for-NamedTempFile%3CF%3E" class="impl"><a href="#impl-Sync-for-NamedTempFile%3CF%3E" class="anchor">§</a><h3 class="code-header">impl<F> <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.NamedTempFile.html" title="struct tempfile::NamedTempFile">NamedTempFile</a><F><div class="where">where
|
||
F: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,</div></h3></section><section id="impl-Unpin-for-NamedTempFile%3CF%3E" class="impl"><a href="#impl-Unpin-for-NamedTempFile%3CF%3E" class="anchor">§</a><h3 class="code-header">impl<F> <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.NamedTempFile.html" title="struct tempfile::NamedTempFile">NamedTempFile</a><F><div class="where">where
|
||
F: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h3></section><section id="impl-UnwindSafe-for-NamedTempFile%3CF%3E" class="impl"><a href="#impl-UnwindSafe-for-NamedTempFile%3CF%3E" class="anchor">§</a><h3 class="code-header">impl<F> <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.NamedTempFile.html" title="struct tempfile::NamedTempFile">NamedTempFile</a><F><div class="where">where
|
||
F: <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>,</div></h3></section></div><h2 id="blanket-implementations" class="section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor">§</a></h2><div id="blanket-implementations-list"><details class="toggle implementors-toggle"><summary><section id="impl-Any-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/any.rs.html#138">Source</a><a href="#impl-Any-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <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>(&self) -> <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<T> <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> 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>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.reference.html">&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<T> <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> 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>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.reference.html">&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<T> <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from-1" 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-1" 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) -> 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<T, 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><U> 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><T>,</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) -> 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><T> 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<T, 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><U> 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><T>,</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) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <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><U>>::<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'>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<T, U> <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> 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><T>,</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> = <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><T>>::<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) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <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><T>>::<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'>Performs the conversion.</div></details></div></details></div><script type="text/json" id="notable-traits-data">{"NamedTempFile<F>":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.NamedTempFile.html\" title=\"struct tempfile::NamedTempFile\">NamedTempFile</a><F></code></h3><pre><code><div class=\"where\">impl<F: <a class=\"trait\" href=\"https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html\" title=\"trait std::io::Read\">Read</a>> <a class=\"trait\" href=\"https://doc.rust-lang.org/1.84.1/std/io/trait.Read.html\" title=\"trait std::io::Read\">Read</a> for <a class=\"struct\" href=\"struct.NamedTempFile.html\" title=\"struct tempfile::NamedTempFile\">NamedTempFile</a><F></div><div class=\"where\">impl<F: <a class=\"trait\" href=\"https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html\" title=\"trait std::io::Write\">Write</a>> <a class=\"trait\" href=\"https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html\" title=\"trait std::io::Write\">Write</a> for <a class=\"struct\" href=\"struct.NamedTempFile.html\" title=\"struct tempfile::NamedTempFile\">NamedTempFile</a><F></div>"}</script></section></div></main></body></html> |