Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-release > by-pkgid > 0c2243f8a1696816431e7210e991fa52 > files > 16331

rust-doc-1.35.0-1.mga7.armv7hl.rpm

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `MetadataExt` trait in crate `std`."><meta name="keywords" content="rust, rustlang, rust-lang, MetadataExt"><title>std::os::windows::fs::MetadataExt - Rust</title><link rel="stylesheet" type="text/css" href="../../../../normalize1.35.0.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc1.35.0.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../dark1.35.0.css"><link rel="stylesheet" type="text/css" href="../../../../light1.35.0.css" id="themeStyle"><script src="../../../../storage1.35.0.js"></script><noscript><link rel="stylesheet" href="../../../../noscript1.35.0.css"></noscript><link rel="shortcut icon" href="../../../../favicon1.35.0.ico"><style type="text/css">#crate-search{background-image:url("../../../../down-arrow1.35.0.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../../../../std/index.html'><img src='../../../../rust-logo1.35.0.png' alt='logo' width='100'></a><p class='location'>Trait MetadataExt</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.creation_time">creation_time</a><a href="#tymethod.file_attributes">file_attributes</a><a href="#tymethod.file_size">file_size</a><a href="#tymethod.last_access_time">last_access_time</a><a href="#tymethod.last_write_time">last_write_time</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='../../../index.html'>std</a>::<wbr><a href='../../index.html'>os</a>::<wbr><a href='../index.html'>windows</a>::<wbr><a href='index.html'>fs</a></p><script>window.sidebarCurrent = {name: 'MetadataExt', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../../brush1.35.0.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../../theme1.35.0.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../../settings.html"><img src="../../../../wheel1.35.0.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span class='since' title='Stable since Rust version 1.1.0'>1.1.0</span><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span><a class='srclink' href='../../../../src/std/sys/windows/ext/fs.rs.html#297-440' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='../../../index.html'>std</a>::<wbr><a href='../../index.html'>os</a>::<wbr><a href='../index.html'>windows</a>::<wbr><a href='index.html'>fs</a>::<wbr><a class="trait" href=''>MetadataExt</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub trait MetadataExt {
    fn <a href='#tymethod.file_attributes' class='fnname'>file_attributes</a>(&amp;self) -&gt; <a class="primitive" href="../../../primitive.u32.html">u32</a>;
<div class='item-spacer'></div>    fn <a href='#tymethod.creation_time' class='fnname'>creation_time</a>(&amp;self) -&gt; <a class="primitive" href="../../../primitive.u64.html">u64</a>;
<div class='item-spacer'></div>    fn <a href='#tymethod.last_access_time' class='fnname'>last_access_time</a>(&amp;self) -&gt; <a class="primitive" href="../../../primitive.u64.html">u64</a>;
<div class='item-spacer'></div>    fn <a href='#tymethod.last_write_time' class='fnname'>last_write_time</a>(&amp;self) -&gt; <a class="primitive" href="../../../primitive.u64.html">u64</a>;
<div class='item-spacer'></div>    fn <a href='#tymethod.file_size' class='fnname'>file_size</a>(&amp;self) -&gt; <a class="primitive" href="../../../primitive.u64.html">u64</a>;
}</pre></div><div class='stability'><div class='stab portability'>This is supported on <strong>Windows</strong> only.</div></div><div class='docblock'><p>Windows-specific extensions to <a href="../../../../std/fs/struct.Metadata.html"><code>fs::Metadata</code></a>.</p>
<p>The data members that this trait exposes correspond to the members
of the <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa363788.aspx"><code>BY_HANDLE_FILE_INFORMATION</code></a> structure.</p>
</div>
            <h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.file_attributes' class='method'><code id='file_attributes.v'>fn <a href='#tymethod.file_attributes' class='fnname'>file_attributes</a>(&amp;self) -&gt; <a class="primitive" href="../../../primitive.u32.html">u32</a></code></h3><div class='stability'><div class='stab portability'>This is supported on <strong>Windows</strong> only.</div></div><div class='docblock'><p>Returns the value of the <code>dwFileAttributes</code> field of this metadata.</p>
<p>This field contains the file system attribute information for a file
or directory. For possible values and their descriptions, see
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/gg258117.aspx">File Attribute Constants</a> in the Windows Dev Center.</p>
<h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">io</span>;
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fs</span>;
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">os</span>::<span class="ident">windows</span>::<span class="ident">prelude</span>::<span class="kw-2">*</span>;

<span class="kw">fn</span> <span class="ident">main</span>() <span class="op">-&gt;</span> <span class="ident">io</span>::<span class="prelude-ty">Result</span><span class="op">&lt;</span>()<span class="op">&gt;</span> {
    <span class="kw">let</span> <span class="ident">metadata</span> <span class="op">=</span> <span class="ident">fs</span>::<span class="ident">metadata</span>(<span class="string">&quot;foo.txt&quot;</span>)<span class="question-mark">?</span>;
    <span class="kw">let</span> <span class="ident">attributes</span> <span class="op">=</span> <span class="ident">metadata</span>.<span class="ident">file_attributes</span>();
    <span class="prelude-val">Ok</span>(())
}<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Ause%20std%3A%3Aio%3B%0Ause%20std%3A%3Afs%3B%0Ause%20std%3A%3Aos%3A%3Awindows%3A%3Aprelude%3A%3A*%3B%0A%0Afn%20main()%20-%3E%20io%3A%3AResult%3C()%3E%20%7B%0A%20%20%20%20let%20metadata%20%3D%20fs%3A%3Ametadata(%22foo.txt%22)%3F%3B%0A%20%20%20%20let%20attributes%20%3D%20metadata.file_attributes()%3B%0A%20%20%20%20Ok(())%0A%7D">Run</a></pre></div>
</div><h3 id='tymethod.creation_time' class='method'><code id='creation_time.v'>fn <a href='#tymethod.creation_time' class='fnname'>creation_time</a>(&amp;self) -&gt; <a class="primitive" href="../../../primitive.u64.html">u64</a></code></h3><div class='stability'><div class='stab portability'>This is supported on <strong>Windows</strong> only.</div></div><div class='docblock'><p>Returns the value of the <code>ftCreationTime</code> field of this metadata.</p>
<p>The returned 64-bit value is equivalent to a <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms724284.aspx"><code>FILETIME</code></a> struct,
which represents the number of 100-nanosecond intervals since
January 1, 1601 (UTC). The struct is automatically
converted to a <code>u64</code> value, as that is the recommended way
to use it.</p>
<p>If the underlying filesystem does not support creation time, the
returned value is 0.</p>
<h1 id="examples-1" class="section-header"><a href="#examples-1">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">io</span>;
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fs</span>;
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">os</span>::<span class="ident">windows</span>::<span class="ident">prelude</span>::<span class="kw-2">*</span>;

<span class="kw">fn</span> <span class="ident">main</span>() <span class="op">-&gt;</span> <span class="ident">io</span>::<span class="prelude-ty">Result</span><span class="op">&lt;</span>()<span class="op">&gt;</span> {
    <span class="kw">let</span> <span class="ident">metadata</span> <span class="op">=</span> <span class="ident">fs</span>::<span class="ident">metadata</span>(<span class="string">&quot;foo.txt&quot;</span>)<span class="question-mark">?</span>;
    <span class="kw">let</span> <span class="ident">creation_time</span> <span class="op">=</span> <span class="ident">metadata</span>.<span class="ident">creation_time</span>();
    <span class="prelude-val">Ok</span>(())
}<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Ause%20std%3A%3Aio%3B%0Ause%20std%3A%3Afs%3B%0Ause%20std%3A%3Aos%3A%3Awindows%3A%3Aprelude%3A%3A*%3B%0A%0Afn%20main()%20-%3E%20io%3A%3AResult%3C()%3E%20%7B%0A%20%20%20%20let%20metadata%20%3D%20fs%3A%3Ametadata(%22foo.txt%22)%3F%3B%0A%20%20%20%20let%20creation_time%20%3D%20metadata.creation_time()%3B%0A%20%20%20%20Ok(())%0A%7D">Run</a></pre></div>
</div><h3 id='tymethod.last_access_time' class='method'><code id='last_access_time.v'>fn <a href='#tymethod.last_access_time' class='fnname'>last_access_time</a>(&amp;self) -&gt; <a class="primitive" href="../../../primitive.u64.html">u64</a></code></h3><div class='stability'><div class='stab portability'>This is supported on <strong>Windows</strong> only.</div></div><div class='docblock'><p>Returns the value of the <code>ftLastAccessTime</code> field of this metadata.</p>
<p>The returned 64-bit value is equivalent to a <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms724284.aspx"><code>FILETIME</code></a> struct,
which represents the number of 100-nanosecond intervals since
January 1, 1601 (UTC). The struct is automatically
converted to a <code>u64</code> value, as that is the recommended way
to use it.</p>
<p>For a file, the value specifies the last time that a file was read
from or written to. For a directory, the value specifies when
the directory was created. For both files and directories, the
specified date is correct, but the time of day is always set to
midnight.</p>
<p>If the underlying filesystem does not support last access time, the
returned value is 0.</p>
<h1 id="examples-2" class="section-header"><a href="#examples-2">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">io</span>;
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fs</span>;
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">os</span>::<span class="ident">windows</span>::<span class="ident">prelude</span>::<span class="kw-2">*</span>;

<span class="kw">fn</span> <span class="ident">main</span>() <span class="op">-&gt;</span> <span class="ident">io</span>::<span class="prelude-ty">Result</span><span class="op">&lt;</span>()<span class="op">&gt;</span> {
    <span class="kw">let</span> <span class="ident">metadata</span> <span class="op">=</span> <span class="ident">fs</span>::<span class="ident">metadata</span>(<span class="string">&quot;foo.txt&quot;</span>)<span class="question-mark">?</span>;
    <span class="kw">let</span> <span class="ident">last_access_time</span> <span class="op">=</span> <span class="ident">metadata</span>.<span class="ident">last_access_time</span>();
    <span class="prelude-val">Ok</span>(())
}<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Ause%20std%3A%3Aio%3B%0Ause%20std%3A%3Afs%3B%0Ause%20std%3A%3Aos%3A%3Awindows%3A%3Aprelude%3A%3A*%3B%0A%0Afn%20main()%20-%3E%20io%3A%3AResult%3C()%3E%20%7B%0A%20%20%20%20let%20metadata%20%3D%20fs%3A%3Ametadata(%22foo.txt%22)%3F%3B%0A%20%20%20%20let%20last_access_time%20%3D%20metadata.last_access_time()%3B%0A%20%20%20%20Ok(())%0A%7D">Run</a></pre></div>
</div><h3 id='tymethod.last_write_time' class='method'><code id='last_write_time.v'>fn <a href='#tymethod.last_write_time' class='fnname'>last_write_time</a>(&amp;self) -&gt; <a class="primitive" href="../../../primitive.u64.html">u64</a></code></h3><div class='stability'><div class='stab portability'>This is supported on <strong>Windows</strong> only.</div></div><div class='docblock'><p>Returns the value of the <code>ftLastWriteTime</code> field of this metadata.</p>
<p>The returned 64-bit value is equivalent to a <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms724284.aspx"><code>FILETIME</code></a> struct,
which represents the number of 100-nanosecond intervals since
January 1, 1601 (UTC). The struct is automatically
converted to a <code>u64</code> value, as that is the recommended way
to use it.</p>
<p>For a file, the value specifies the last time that a file was written
to. For a directory, the structure specifies when the directory was
created.</p>
<p>If the underlying filesystem does not support the last write time,
the returned value is 0.</p>
<h1 id="examples-3" class="section-header"><a href="#examples-3">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">io</span>;
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fs</span>;
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">os</span>::<span class="ident">windows</span>::<span class="ident">prelude</span>::<span class="kw-2">*</span>;

<span class="kw">fn</span> <span class="ident">main</span>() <span class="op">-&gt;</span> <span class="ident">io</span>::<span class="prelude-ty">Result</span><span class="op">&lt;</span>()<span class="op">&gt;</span> {
    <span class="kw">let</span> <span class="ident">metadata</span> <span class="op">=</span> <span class="ident">fs</span>::<span class="ident">metadata</span>(<span class="string">&quot;foo.txt&quot;</span>)<span class="question-mark">?</span>;
    <span class="kw">let</span> <span class="ident">last_write_time</span> <span class="op">=</span> <span class="ident">metadata</span>.<span class="ident">last_write_time</span>();
    <span class="prelude-val">Ok</span>(())
}<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Ause%20std%3A%3Aio%3B%0Ause%20std%3A%3Afs%3B%0Ause%20std%3A%3Aos%3A%3Awindows%3A%3Aprelude%3A%3A*%3B%0A%0Afn%20main()%20-%3E%20io%3A%3AResult%3C()%3E%20%7B%0A%20%20%20%20let%20metadata%20%3D%20fs%3A%3Ametadata(%22foo.txt%22)%3F%3B%0A%20%20%20%20let%20last_write_time%20%3D%20metadata.last_write_time()%3B%0A%20%20%20%20Ok(())%0A%7D">Run</a></pre></div>
</div><h3 id='tymethod.file_size' class='method'><code id='file_size.v'>fn <a href='#tymethod.file_size' class='fnname'>file_size</a>(&amp;self) -&gt; <a class="primitive" href="../../../primitive.u64.html">u64</a></code></h3><div class='stability'><div class='stab portability'>This is supported on <strong>Windows</strong> only.</div></div><div class='docblock'><p>Returns the value of the <code>nFileSize{High,Low}</code> fields of this
metadata.</p>
<p>The returned value does not have meaning for directories.</p>
<h1 id="examples-4" class="section-header"><a href="#examples-4">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">io</span>;
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fs</span>;
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">os</span>::<span class="ident">windows</span>::<span class="ident">prelude</span>::<span class="kw-2">*</span>;

<span class="kw">fn</span> <span class="ident">main</span>() <span class="op">-&gt;</span> <span class="ident">io</span>::<span class="prelude-ty">Result</span><span class="op">&lt;</span>()<span class="op">&gt;</span> {
    <span class="kw">let</span> <span class="ident">metadata</span> <span class="op">=</span> <span class="ident">fs</span>::<span class="ident">metadata</span>(<span class="string">&quot;foo.txt&quot;</span>)<span class="question-mark">?</span>;
    <span class="kw">let</span> <span class="ident">file_size</span> <span class="op">=</span> <span class="ident">metadata</span>.<span class="ident">file_size</span>();
    <span class="prelude-val">Ok</span>(())
}<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Ause%20std%3A%3Aio%3B%0Ause%20std%3A%3Afs%3B%0Ause%20std%3A%3Aos%3A%3Awindows%3A%3Aprelude%3A%3A*%3B%0A%0Afn%20main()%20-%3E%20io%3A%3AResult%3C()%3E%20%7B%0A%20%20%20%20let%20metadata%20%3D%20fs%3A%3Ametadata(%22foo.txt%22)%3F%3B%0A%20%20%20%20let%20file_size%20%3D%20metadata.file_size()%3B%0A%20%20%20%20Ok(())%0A%7D">Run</a></pre></div>
</div></div><span class='loading-content'>Loading content...</span>
            <h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'><h3 id='impl-MetadataExt' class='impl'><code class='in-band'>impl MetadataExt for <a class="struct" href="../../../../std/fs/struct.Metadata.html" title="struct std::fs::Metadata">Metadata</a></code><a href='#impl-MetadataExt' class='anchor'></a><a class='srclink' href='../../../../src/std/sys/windows/ext/fs.rs.html#443-449' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.file_attributes' class="method hidden"><code id='file_attributes.v-1'>fn <a href='#method.file_attributes' class='fnname'>file_attributes</a>(&amp;self) -&gt; <a class="primitive" href="../../../primitive.u32.html">u32</a></code><a class='srclink' href='../../../../src/std/sys/windows/ext/fs.rs.html#444' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab portability'>This is supported on <strong>Windows</strong> only.</div></div><h4 id='method.creation_time' class="method hidden"><code id='creation_time.v-1'>fn <a href='#method.creation_time' class='fnname'>creation_time</a>(&amp;self) -&gt; <a class="primitive" href="../../../primitive.u64.html">u64</a></code><a class='srclink' href='../../../../src/std/sys/windows/ext/fs.rs.html#445' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab portability'>This is supported on <strong>Windows</strong> only.</div></div><h4 id='method.last_access_time' class="method hidden"><code id='last_access_time.v-1'>fn <a href='#method.last_access_time' class='fnname'>last_access_time</a>(&amp;self) -&gt; <a class="primitive" href="../../../primitive.u64.html">u64</a></code><a class='srclink' href='../../../../src/std/sys/windows/ext/fs.rs.html#446' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab portability'>This is supported on <strong>Windows</strong> only.</div></div><h4 id='method.last_write_time' class="method hidden"><code id='last_write_time.v-1'>fn <a href='#method.last_write_time' class='fnname'>last_write_time</a>(&amp;self) -&gt; <a class="primitive" href="../../../primitive.u64.html">u64</a></code><a class='srclink' href='../../../../src/std/sys/windows/ext/fs.rs.html#447' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab portability'>This is supported on <strong>Windows</strong> only.</div></div><h4 id='method.file_size' class="method hidden"><code id='file_size.v-1'>fn <a href='#method.file_size' class='fnname'>file_size</a>(&amp;self) -&gt; <a class="primitive" href="../../../primitive.u64.html">u64</a></code><a class='srclink' href='../../../../src/std/sys/windows/ext/fs.rs.html#448' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab portability'>This is supported on <strong>Windows</strong> only.</div></div></div></div><span class='loading-content'>Loading content...</span><script type="text/javascript">window.inlined_types=new Set([]);</script><script type="text/javascript" async
                         src="../../../../implementors/std/os/windows/fs/trait.MetadataExt.js">
                 </script></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>&#9166;</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../../../";window.currentCrate = "std";</script><script src="../../../../aliases.js"></script><script src="../../../../main1.35.0.js"></script><script defer src="../../../../search-index.js"></script></body></html>