Sophie

Sophie

distrib > Mageia > 6 > x86_64 > media > core-updates > by-pkgid > e50df336eb49b92dbadf6dedc48b7934 > files > 14842

rust-doc-1.27.0-1.mga6.x86_64.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 `SystemTime` struct in crate `std`."><meta name="keywords" content="rust, rustlang, rust-lang, SystemTime"><title>std::time::SystemTime - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><link rel="shortcut icon" href="https://doc.rust-lang.org/favicon.ico"></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../../std/index.html'><img src='https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png' alt='logo' width='100'></a><p class='location'>Struct SystemTime</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.now">now</a><a href="#method.duration_since">duration_since</a><a href="#method.elapsed">elapsed</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Copy">Copy</a><a href="#impl-Clone">Clone</a><a href="#impl-PartialEq">PartialEq</a><a href="#impl-Eq">Eq</a><a href="#impl-PartialOrd">PartialOrd</a><a href="#impl-Ord">Ord</a><a href="#impl-Hash">Hash</a><a href="#impl-Add%3CDuration%3E">Add&lt;Duration&gt;</a><a href="#impl-AddAssign%3CDuration%3E">AddAssign&lt;Duration&gt;</a><a href="#impl-Sub%3CDuration%3E">Sub&lt;Duration&gt;</a><a href="#impl-SubAssign%3CDuration%3E">SubAssign&lt;Duration&gt;</a><a href="#impl-Debug">Debug</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a></div></div><p class='location'><a href='../index.html'>std</a>::<wbr><a href='index.html'>time</a></p><script>window.sidebarCurrent = {name: 'SystemTime', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='in-band'>Struct <a href='../index.html'>std</a>::<wbr><a href='index.html'>time</a>::<wbr><a class="struct" href=''>SystemTime</a></span><span class='out-of-band'><span class='since' title='Stable since Rust version 1.8.0'>1.8.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/time.rs.html#127' title='goto source code'>[src]</a></span></h1><div class="docblock type-decl"><pre class='rust struct'>pub struct SystemTime(_);</pre></div><div class='docblock'><p>A measurement of the system clock, useful for talking to
external entities like the file system or other processes.</p>
<p>Distinct from the <a href="../../std/time/struct.Instant.html"><code>Instant</code></a> type, this time measurement <strong>is not
monotonic</strong>. This means that you can save a file to the file system, then
save another file to the file system, <strong>and the second file has a
<code>SystemTime</code> measurement earlier than the first</strong>. In other words, an
operation that happens after another operation in real time may have an
earlier <code>SystemTime</code>!</p>
<p>Consequently, comparing two <code>SystemTime</code> instances to learn about the
duration between them returns a <a href="../../std/result/enum.Result.html"><code>Result</code></a> instead of an infallible <a href="../../std/time/struct.Duration.html"><code>Duration</code></a>
to indicate that this sort of time drift may happen and needs to be handled.</p>
<p>Although a <code>SystemTime</code> cannot be directly inspected, the <a href="../../std/time/constant.UNIX_EPOCH.html"><code>UNIX_EPOCH</code></a>
constant is provided in this module as an anchor in time to learn
information about a <code>SystemTime</code>. By calculating the duration from this
fixed point in time, a <code>SystemTime</code> can be converted to a human-readable time,
or perhaps some other string representation.</p>
<p>The size of a <code>SystemTime</code> struct may vary depending on the target operating
system.</p>
<p>Example:</p>

<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">time</span>::{<span class="ident">Duration</span>, <span class="ident">SystemTime</span>};
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">thread</span>::<span class="ident">sleep</span>;

<span class="kw">fn</span> <span class="ident">main</span>() {
   <span class="kw">let</span> <span class="ident">now</span> <span class="op">=</span> <span class="ident">SystemTime</span>::<span class="ident">now</span>();

   <span class="comment">// we sleep for 2 seconds</span>
   <span class="ident">sleep</span>(<span class="ident">Duration</span>::<span class="ident">new</span>(<span class="number">2</span>, <span class="number">0</span>));
   <span class="kw">match</span> <span class="ident">now</span>.<span class="ident">elapsed</span>() {
       <span class="prelude-val">Ok</span>(<span class="ident">elapsed</span>) <span class="op">=&gt;</span> {
           <span class="comment">// it prints &#39;2&#39;</span>
           <span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">elapsed</span>.<span class="ident">as_secs</span>());
       }
       <span class="prelude-val">Err</span>(<span class="ident">e</span>) <span class="op">=&gt;</span> {
           <span class="comment">// an error occurred!</span>
           <span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;Error: {:?}&quot;</span>, <span class="ident">e</span>);
       }
   }
}<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Ause%20std%3A%3Atime%3A%3A%7BDuration%2C%20SystemTime%7D%3B%0Ause%20std%3A%3Athread%3A%3Asleep%3B%0A%0Afn%20main()%20%7B%0A%20%20%20let%20now%20%3D%20SystemTime%3A%3Anow()%3B%0A%0A%20%20%20%2F%2F%20we%20sleep%20for%202%20seconds%0A%20%20%20sleep(Duration%3A%3Anew(2%2C%200))%3B%0A%20%20%20match%20now.elapsed()%20%7B%0A%20%20%20%20%20%20%20Ok(elapsed)%20%3D%3E%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20it%20prints%20'2'%0A%20%20%20%20%20%20%20%20%20%20%20println!(%22%7B%7D%22%2C%20elapsed.as_secs())%3B%0A%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20Err(e)%20%3D%3E%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20an%20error%20occurred!%0A%20%20%20%20%20%20%20%20%20%20%20println!(%22Error%3A%20%7B%3A%3F%7D%22%2C%20e)%3B%0A%20%20%20%20%20%20%20%7D%0A%20%20%20%7D%0A%7D">Run</a></pre>
</div>
                    <h2 id='methods' class='small-section-header'>
                      Methods<a href='#methods' class='anchor'></a>
                    </h2>
                <h3 id='impl' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="struct" href="../../std/time/struct.SystemTime.html" title="struct std::time::SystemTime">SystemTime</a></code><a href='#impl' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/time.rs.html#261-361' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='associatedconstant.UNIX_EPOCH' class="associatedconstant"><span id='UNIX_EPOCH.v' class='invisible'><code>pub const <a href='#associatedconstant.UNIX_EPOCH' class="constant"><b>UNIX_EPOCH</b></a>: <a class="struct" href="../../std/time/struct.SystemTime.html" title="struct std::time::SystemTime">SystemTime</a></code></span></h4>
<div class='stability'><div class='stab unstable'><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>assoc_unix_epoch </code><a href="https://github.com/rust-lang/rust/issues/49502">#49502</a>)</div></div><div class='docblock'><pre class="rust ">
<span class="ident">UNIX_EPOCH</span>: <span class="ident">SystemTime</span> <span class="op">=</span> <span class="ident">UNIX_EPOCH</span></pre>
<p>An anchor in time which can be used to create new <code>SystemTime</code> instances or
learn about where in time a <code>SystemTime</code> lies.</p>
<p>This constant is defined to be &quot;1970-01-01 00:00:00 UTC&quot; on all systems with
respect to the system clock. Using <code>duration_since</code> on an existing
<code>SystemTime</code> instance can tell how far away from this point in time a
measurement lies, and using <code>UNIX_EPOCH + duration</code> can be used to create a
<code>SystemTime</code> instance to represent another fixed point in time.</p>
<h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="attribute">#![<span class="ident">feature</span>(<span class="ident">assoc_unix_epoch</span>)]</span>
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">time</span>::<span class="ident">SystemTime</span>;

<span class="kw">match</span> <span class="ident">SystemTime</span>::<span class="ident">now</span>().<span class="ident">duration_since</span>(<span class="ident">SystemTime</span>::<span class="ident">UNIX_EPOCH</span>) {
    <span class="prelude-val">Ok</span>(<span class="ident">n</span>) <span class="op">=&gt;</span> <span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;1970-01-01 00:00:00 UTC was {} seconds ago!&quot;</span>, <span class="ident">n</span>.<span class="ident">as_secs</span>()),
    <span class="prelude-val">Err</span>(<span class="kw">_</span>) <span class="op">=&gt;</span> <span class="macro">panic</span><span class="macro">!</span>(<span class="string">&quot;SystemTime before UNIX EPOCH!&quot;</span>),
}<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0A%23!%5Bfeature(assoc_unix_epoch)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Atime%3A%3ASystemTime%3B%0A%0Amatch%20SystemTime%3A%3Anow().duration_since(SystemTime%3A%3AUNIX_EPOCH)%20%7B%0A%20%20%20%20Ok(n)%20%3D%3E%20println!(%221970-01-01%2000%3A00%3A00%20UTC%20was%20%7B%7D%20seconds%20ago!%22%2C%20n.as_secs())%2C%0A%20%20%20%20Err(_)%20%3D%3E%20panic!(%22SystemTime%20before%20UNIX%20EPOCH!%22)%2C%0A%7D%0A%7D&amp;version=nightly">Run</a></pre>
</div><h4 id='method.now' class="method"><span id='now.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.now' class='fnname'>now</a>() -&gt; <a class="struct" href="../../std/time/struct.SystemTime.html" title="struct std::time::SystemTime">SystemTime</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/time.rs.html#295-297' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns the system time corresponding to &quot;now&quot;.</p>
<h1 id="examples-1" class="section-header"><a href="#examples-1">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">time</span>::<span class="ident">SystemTime</span>;

<span class="kw">let</span> <span class="ident">sys_time</span> <span class="op">=</span> <span class="ident">SystemTime</span>::<span class="ident">now</span>();<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Atime%3A%3ASystemTime%3B%0A%0Alet%20sys_time%20%3D%20SystemTime%3A%3Anow()%3B%0A%7D">Run</a></pre>
</div><h4 id='method.duration_since' class="method"><span id='duration_since.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.duration_since' class='fnname'>duration_since</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;earlier: <a class="struct" href="../../std/time/struct.SystemTime.html" title="struct std::time::SystemTime">SystemTime</a><br>) -&gt; <a class="enum" href="../../std/result/enum.Result.html" title="enum std::result::Result">Result</a>&lt;<a class="struct" href="../../std/time/struct.Duration.html" title="struct std::time::Duration">Duration</a>, <a class="struct" href="../../std/time/struct.SystemTimeError.html" title="struct std::time::SystemTimeError">SystemTimeError</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/time.rs.html#326-329' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns the amount of time elapsed from an earlier point in time.</p>
<p>This function may fail because measurements taken earlier are not
guaranteed to always be before later measurements (due to anomalies such
as the system clock being adjusted either forwards or backwards).</p>
<p>If successful, <a href="../../std/result/enum.Result.html#variant.Ok"><code>Ok</code></a><code>(</code><a href="../../std/time/struct.Duration.html"><code>Duration</code></a><code>)</code> is returned where the duration represents
the amount of time elapsed from the specified measurement to this one.</p>
<p>Returns an <a href="../../std/result/enum.Result.html#variant.Err"><code>Err</code></a> if <code>earlier</code> is later than <code>self</code>, and the error
contains how far from <code>self</code> the time is.</p>
<h1 id="examples-2" class="section-header"><a href="#examples-2">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">time</span>::<span class="ident">SystemTime</span>;

<span class="kw">let</span> <span class="ident">sys_time</span> <span class="op">=</span> <span class="ident">SystemTime</span>::<span class="ident">now</span>();
<span class="kw">let</span> <span class="ident">difference</span> <span class="op">=</span> <span class="ident">sys_time</span>.<span class="ident">duration_since</span>(<span class="ident">sys_time</span>)
                         .<span class="ident">expect</span>(<span class="string">&quot;SystemTime::duration_since failed&quot;</span>);
<span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;{:?}&quot;</span>, <span class="ident">difference</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Atime%3A%3ASystemTime%3B%0A%0Alet%20sys_time%20%3D%20SystemTime%3A%3Anow()%3B%0Alet%20difference%20%3D%20sys_time.duration_since(sys_time)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.expect(%22SystemTime%3A%3Aduration_since%20failed%22)%3B%0Aprintln!(%22%7B%3A%3F%7D%22%2C%20difference)%3B%0A%7D">Run</a></pre>
</div><h4 id='method.elapsed' class="method"><span id='elapsed.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.elapsed' class='fnname'>elapsed</a>(&amp;self) -&gt; <a class="enum" href="../../std/result/enum.Result.html" title="enum std::result::Result">Result</a>&lt;<a class="struct" href="../../std/time/struct.Duration.html" title="struct std::time::Duration">Duration</a>, <a class="struct" href="../../std/time/struct.SystemTimeError.html" title="struct std::time::SystemTimeError">SystemTimeError</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/time.rs.html#358-360' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns the amount of time elapsed since this system time was created.</p>
<p>This function may fail as the underlying system clock is susceptible to
drift and updates (e.g. the system clock could go backwards), so this
function may not always succeed. If successful, <a href="../../std/result/enum.Result.html#variant.Ok"><code>Ok</code></a><code>(</code><a href="../../std/time/struct.Duration.html"><code>Duration</code></a><code>)</code> is
returned where the duration represents the amount of time elapsed from
this time measurement to the current time.</p>
<p>Returns an <a href="../../std/result/enum.Result.html#variant.Err"><code>Err</code></a> if <code>self</code> is later than the current system time, and
the error contains how far from the current system time <code>self</code> is.</p>
<h1 id="examples-3" class="section-header"><a href="#examples-3">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">thread</span>::<span class="ident">sleep</span>;
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">time</span>::{<span class="ident">Duration</span>, <span class="ident">SystemTime</span>};

<span class="kw">let</span> <span class="ident">sys_time</span> <span class="op">=</span> <span class="ident">SystemTime</span>::<span class="ident">now</span>();
<span class="kw">let</span> <span class="ident">one_sec</span> <span class="op">=</span> <span class="ident">Duration</span>::<span class="ident">from_secs</span>(<span class="number">1</span>);
<span class="ident">sleep</span>(<span class="ident">one_sec</span>);
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">sys_time</span>.<span class="ident">elapsed</span>().<span class="ident">unwrap</span>() <span class="op">&gt;=</span> <span class="ident">one_sec</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Athread%3A%3Asleep%3B%0Ause%20std%3A%3Atime%3A%3A%7BDuration%2C%20SystemTime%7D%3B%0A%0Alet%20sys_time%20%3D%20SystemTime%3A%3Anow()%3B%0Alet%20one_sec%20%3D%20Duration%3A%3Afrom_secs(1)%3B%0Asleep(one_sec)%3B%0Aassert!(sys_time.elapsed().unwrap()%20%3E%3D%20one_sec)%3B%0A%7D">Run</a></pre>
</div></div>
                <h2 id='implementations' class='small-section-header'>
                  Trait Implementations<a href='#implementations' class='anchor'></a>
                </h2>
                <div id='implementations-list'><h3 id='impl-Copy' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../../std/marker/trait.Copy.html" title="trait std::marker::Copy">Copy</a> for <a class="struct" href="../../std/time/struct.SystemTime.html" title="struct std::time::SystemTime">SystemTime</a></code><a href='#impl-Copy' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/time.rs.html#125' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'></div><h3 id='impl-Clone' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../../std/clone/trait.Clone.html" title="trait std::clone::Clone">Clone</a> for <a class="struct" href="../../std/time/struct.SystemTime.html" title="struct std::time::SystemTime">SystemTime</a></code><a href='#impl-Clone' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/time.rs.html#125' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.clone' class="method"><span id='clone.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&amp;self) -&gt; <a class="struct" href="../../std/time/struct.SystemTime.html" title="struct std::time::SystemTime">SystemTime</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/time.rs.html#125' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns a copy of the value. <a href="../../std/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div><h4 id='method.clone_from' class="method"><span id='clone_from.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&amp;mut self, source: <a class="primitive" href="../primitive.reference.html">&amp;</a>Self)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div><a class='srclink' href='../../src/core/clone.rs.html#130-132' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="../../std/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></div><h3 id='impl-PartialEq' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../../std/cmp/trait.PartialEq.html" title="trait std::cmp::PartialEq">PartialEq</a> for <a class="struct" href="../../std/time/struct.SystemTime.html" title="struct std::time::SystemTime">SystemTime</a></code><a href='#impl-PartialEq' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/time.rs.html#125' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.eq' class="method"><span id='eq.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&amp;self, other: &amp;<a class="struct" href="../../std/time/struct.SystemTime.html" title="struct std::time::SystemTime">SystemTime</a>) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/time.rs.html#125' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="../../std/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
</div><h4 id='method.ne' class="method"><span id='ne.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&amp;self, other: &amp;<a class="struct" href="../../std/time/struct.SystemTime.html" title="struct std::time::SystemTime">SystemTime</a>) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/time.rs.html#125' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>This method tests for <code>!=</code>.</p>
</div></div><h3 id='impl-Eq' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../../std/cmp/trait.Eq.html" title="trait std::cmp::Eq">Eq</a> for <a class="struct" href="../../std/time/struct.SystemTime.html" title="struct std::time::SystemTime">SystemTime</a></code><a href='#impl-Eq' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/time.rs.html#125' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'></div><h3 id='impl-PartialOrd' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../../std/cmp/trait.PartialOrd.html" title="trait std::cmp::PartialOrd">PartialOrd</a> for <a class="struct" href="../../std/time/struct.SystemTime.html" title="struct std::time::SystemTime">SystemTime</a></code><a href='#impl-PartialOrd' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/time.rs.html#125' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.partial_cmp' class="method"><span id='partial_cmp.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&amp;self, other: &amp;<a class="struct" href="../../std/time/struct.SystemTime.html" title="struct std::time::SystemTime">SystemTime</a>) -&gt; <a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;<a class="enum" href="../../std/cmp/enum.Ordering.html" title="enum std::cmp::Ordering">Ordering</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/time.rs.html#125' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="../../std/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
</div><h4 id='method.lt' class="method"><span id='lt.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&amp;self, other: &amp;<a class="struct" href="../../std/time/struct.SystemTime.html" title="struct std::time::SystemTime">SystemTime</a>) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/time.rs.html#125' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
</div><h4 id='method.le' class="method"><span id='le.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&amp;self, other: &amp;<a class="struct" href="../../std/time/struct.SystemTime.html" title="struct std::time::SystemTime">SystemTime</a>) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/time.rs.html#125' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;=</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
</div><h4 id='method.gt' class="method"><span id='gt.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&amp;self, other: &amp;<a class="struct" href="../../std/time/struct.SystemTime.html" title="struct std::time::SystemTime">SystemTime</a>) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/time.rs.html#125' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
</div><h4 id='method.ge' class="method"><span id='ge.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&amp;self, other: &amp;<a class="struct" href="../../std/time/struct.SystemTime.html" title="struct std::time::SystemTime">SystemTime</a>) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/time.rs.html#125' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;=</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
</div></div><h3 id='impl-Ord' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../../std/cmp/trait.Ord.html" title="trait std::cmp::Ord">Ord</a> for <a class="struct" href="../../std/time/struct.SystemTime.html" title="struct std::time::SystemTime">SystemTime</a></code><a href='#impl-Ord' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/time.rs.html#125' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.cmp' class="method"><span id='cmp.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/cmp/trait.Ord.html#tymethod.cmp' class='fnname'>cmp</a>(&amp;self, other: &amp;<a class="struct" href="../../std/time/struct.SystemTime.html" title="struct std::time::SystemTime">SystemTime</a>) -&gt; <a class="enum" href="../../std/cmp/enum.Ordering.html" title="enum std::cmp::Ordering">Ordering</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/time.rs.html#125' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>This method returns an <code>Ordering</code> between <code>self</code> and <code>other</code>. <a href="../../std/cmp/trait.Ord.html#tymethod.cmp">Read more</a></p>
</div><h4 id='method.max' class="method"><span id='max.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/cmp/trait.Ord.html#method.max' class='fnname'>max</a>(self, other: Self) -&gt; Self</code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.21.0'>1.21.0</div><a class='srclink' href='../../src/core/cmp.rs.html#469-472' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Compares and returns the maximum of two values. <a href="../../std/cmp/trait.Ord.html#method.max">Read more</a></p>
</div><h4 id='method.min' class="method"><span id='min.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/cmp/trait.Ord.html#method.min' class='fnname'>min</a>(self, other: Self) -&gt; Self</code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.21.0'>1.21.0</div><a class='srclink' href='../../src/core/cmp.rs.html#485-488' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Compares and returns the minimum of two values. <a href="../../std/cmp/trait.Ord.html#method.min">Read more</a></p>
</div></div><h3 id='impl-Hash' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../../std/hash/trait.Hash.html" title="trait std::hash::Hash">Hash</a> for <a class="struct" href="../../std/time/struct.SystemTime.html" title="struct std::time::SystemTime">SystemTime</a></code><a href='#impl-Hash' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/time.rs.html#125' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.hash' class="method"><span id='hash.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/hash/trait.Hash.html#tymethod.hash' class='fnname'>hash</a>&lt;__H:&nbsp;<a class="trait" href="../../std/hash/trait.Hasher.html" title="trait std::hash::Hasher">Hasher</a>&gt;(&amp;self, state: <a class="primitive" href="../primitive.reference.html">&amp;mut </a>__H)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/time.rs.html#125' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Feeds this value into the given [<code>Hasher</code>]. <a href="../../std/hash/trait.Hash.html#tymethod.hash">Read more</a></p>
</div><h4 id='method.hash_slice' class="method"><span id='hash_slice.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/hash/trait.Hash.html#method.hash_slice' class='fnname'>hash_slice</a>&lt;H&gt;(data: <a class="primitive" href="../primitive.slice.html">&amp;[Self]</a>, state: <a class="primitive" href="../primitive.reference.html">&amp;mut </a>H) <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;H: <a class="trait" href="../../std/hash/trait.Hasher.html" title="trait std::hash::Hasher">Hasher</a>,&nbsp;</span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.3.0'>1.3.0</div><a class='srclink' href='../../src/core/hash/mod.rs.html#203-209' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Feeds a slice of this type into the given [<code>Hasher</code>]. <a href="../../std/hash/trait.Hash.html#method.hash_slice">Read more</a></p>
</div></div><h3 id='impl-Add%3CDuration%3E' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../../std/ops/trait.Add.html" title="trait std::ops::Add">Add</a>&lt;<a class="struct" href="../../std/time/struct.Duration.html" title="struct std::time::Duration">Duration</a>&gt; for <a class="struct" href="../../std/time/struct.SystemTime.html" title="struct std::time::SystemTime">SystemTime</a></code><a href='#impl-Add%3CDuration%3E' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/time.rs.html#364-370' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='associatedtype.Output' class="type"><span id='Output.t' class='invisible'><code>type <a href='../../std/ops/trait.Add.html#associatedtype.Output' class="type">Output</a> = <a class="struct" href="../../std/time/struct.SystemTime.html" title="struct std::time::SystemTime">SystemTime</a></code></span></h4>
<div class='docblock'><p>The resulting type after applying the <code>+</code> operator.</p>
</div><h4 id='method.add' class="method"><span id='add.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/ops/trait.Add.html#tymethod.add' class='fnname'>add</a>(self, dur: <a class="struct" href="../../std/time/struct.Duration.html" title="struct std::time::Duration">Duration</a>) -&gt; <a class="struct" href="../../std/time/struct.SystemTime.html" title="struct std::time::SystemTime">SystemTime</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/time.rs.html#367-369' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Performs the <code>+</code> operation.</p>
</div></div><h3 id='impl-AddAssign%3CDuration%3E' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../../std/ops/trait.AddAssign.html" title="trait std::ops::AddAssign">AddAssign</a>&lt;<a class="struct" href="../../std/time/struct.Duration.html" title="struct std::time::Duration">Duration</a>&gt; for <a class="struct" href="../../std/time/struct.SystemTime.html" title="struct std::time::SystemTime">SystemTime</a></code><a href='#impl-AddAssign%3CDuration%3E' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.9.0'>1.9.0</div><a class='srclink' href='../../src/std/time.rs.html#373-377' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.add_assign' class="method"><span id='add_assign.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/ops/trait.AddAssign.html#tymethod.add_assign' class='fnname'>add_assign</a>(&amp;mut self, other: <a class="struct" href="../../std/time/struct.Duration.html" title="struct std::time::Duration">Duration</a>)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/time.rs.html#374-376' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Performs the <code>+=</code> operation.</p>
</div></div><h3 id='impl-Sub%3CDuration%3E' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../../std/ops/trait.Sub.html" title="trait std::ops::Sub">Sub</a>&lt;<a class="struct" href="../../std/time/struct.Duration.html" title="struct std::time::Duration">Duration</a>&gt; for <a class="struct" href="../../std/time/struct.SystemTime.html" title="struct std::time::SystemTime">SystemTime</a></code><a href='#impl-Sub%3CDuration%3E' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/time.rs.html#380-386' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='associatedtype.Output-1' class="type"><span id='Output.t-1' class='invisible'><code>type <a href='../../std/ops/trait.Sub.html#associatedtype.Output' class="type">Output</a> = <a class="struct" href="../../std/time/struct.SystemTime.html" title="struct std::time::SystemTime">SystemTime</a></code></span></h4>
<div class='docblock'><p>The resulting type after applying the <code>-</code> operator.</p>
</div><h4 id='method.sub' class="method"><span id='sub.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/ops/trait.Sub.html#tymethod.sub' class='fnname'>sub</a>(self, dur: <a class="struct" href="../../std/time/struct.Duration.html" title="struct std::time::Duration">Duration</a>) -&gt; <a class="struct" href="../../std/time/struct.SystemTime.html" title="struct std::time::SystemTime">SystemTime</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/time.rs.html#383-385' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Performs the <code>-</code> operation.</p>
</div></div><h3 id='impl-SubAssign%3CDuration%3E' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../../std/ops/trait.SubAssign.html" title="trait std::ops::SubAssign">SubAssign</a>&lt;<a class="struct" href="../../std/time/struct.Duration.html" title="struct std::time::Duration">Duration</a>&gt; for <a class="struct" href="../../std/time/struct.SystemTime.html" title="struct std::time::SystemTime">SystemTime</a></code><a href='#impl-SubAssign%3CDuration%3E' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.9.0'>1.9.0</div><a class='srclink' href='../../src/std/time.rs.html#389-393' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.sub_assign' class="method"><span id='sub_assign.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/ops/trait.SubAssign.html#tymethod.sub_assign' class='fnname'>sub_assign</a>(&amp;mut self, other: <a class="struct" href="../../std/time/struct.Duration.html" title="struct std::time::Duration">Duration</a>)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/time.rs.html#390-392' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Performs the <code>-=</code> operation.</p>
</div></div><h3 id='impl-Debug' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../../std/fmt/trait.Debug.html" title="trait std::fmt::Debug">Debug</a> for <a class="struct" href="../../std/time/struct.SystemTime.html" title="struct std::time::SystemTime">SystemTime</a></code><a href='#impl-Debug' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/time.rs.html#396-400' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.fmt' class="method"><span id='fmt.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="../../std/fmt/struct.Formatter.html" title="struct std::fmt::Formatter">Formatter</a>) -&gt; <a class="type" href="../../std/fmt/type.Result.html" title="type std::fmt::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/time.rs.html#397-399' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Formats the value using the given formatter. <a href="../../std/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></div></div>
                <h2 id='synthetic-implementations' class='small-section-header'>
                  Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a>
                </h2>
                <div id='synthetic-implementations-list'>
            <h3 id='impl-Send' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../../std/marker/trait.Send.html" title="trait std::marker::Send">Send</a> for <a class="struct" href="../../std/time/struct.SystemTime.html" title="struct std::time::SystemTime">SystemTime</a></code><a href='#impl-Send' class='anchor'></a></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../../std/marker/trait.Sync.html" title="trait std::marker::Sync">Sync</a> for <a class="struct" href="../../std/time/struct.SystemTime.html" title="struct std::time::SystemTime">SystemTime</a></code><a href='#impl-Sync' class='anchor'></a></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>&#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="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>