Sophie

Sophie

distrib > Mageia > 6 > x86_64 > media > core-updates > by-pkgid > 878cdd00a13d17a73c6619a777ef5d74 > files > 5320

rust-doc-1.19.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">
    <link rel="stylesheet" type="text/css" href="../../main.css">
    

    <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">
        <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="block items"><ul><li><a href="#methods">Methods</a></li><li><a href="#implementations">Trait Implementations</a></li></ul></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>
    </nav>

    <nav class="sub">
        <form class="search-form js-only">
            <div class="search-container">
                <input class="search-input" name="search"
                       autocomplete="off"
                       placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
                       type="search">
            </div>
        </form>
    </nav>

    <section id='main' class="content">
<h1 class='fqn'><span class='in-band'>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/mod.rs.html#123' title='goto source code'>[src]</a></span></h1>
<pre class='rust struct'>pub struct SystemTime(_);</pre><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>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 occured!</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=use%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%20occured!%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%0A">Run</a></pre>
</div><h2 id='methods'>Methods</h2><h3 class='impl'><span class='in-band'><code>impl <a class="struct" href="../../std/time/struct.SystemTime.html" title="struct std::time::SystemTime">SystemTime</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/time/mod.rs.html#260-337' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.now' class="method"><span id='now.v' class='invisible'><code>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></h4>
<div class='docblock'><p>Returns the system time corresponding to &quot;now&quot;.</p>

<h1 id='examples' class='section-header'><a href='#examples'>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=fn%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'><code>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></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-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>();
<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=fn%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'><code>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></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-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">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=fn%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'>Trait Implementations</h2><h3 class='impl'><span class='in-band'><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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/time/mod.rs.html#121' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'></div><h3 class='impl'><span class='in-band'><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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/time/mod.rs.html#121' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.clone' class="method"><span id='clone.v' class='invisible'><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></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'><code>fn <a href='../../std/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&amp;mut self, source: &amp;Self)</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></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 class='impl'><span class='in-band'><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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/time/mod.rs.html#121' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.eq' class="method"><span id='eq.v' class='invisible'><code>fn <a href='../../std/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&amp;self, __arg_0: &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></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'><code>fn <a href='../../std/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&amp;self, __arg_0: &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></h4>
<div class='docblock'><p>This method tests for <code>!=</code>.</p>
</div></div><h3 class='impl'><span class='in-band'><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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/time/mod.rs.html#121' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'></div><h3 class='impl'><span class='in-band'><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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/time/mod.rs.html#121' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.partial_cmp' class="method"><span id='partial_cmp.v' class='invisible'><code>fn <a href='../../std/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&amp;self, __arg_0: &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></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'><code>fn <a href='../../std/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&amp;self, __arg_0: &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></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'><code>fn <a href='../../std/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&amp;self, __arg_0: &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></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'><code>fn <a href='../../std/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&amp;self, __arg_0: &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></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'><code>fn <a href='../../std/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&amp;self, __arg_0: &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></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 class='impl'><span class='in-band'><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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/time/mod.rs.html#121' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.cmp' class="method"><span id='cmp.v' class='invisible'><code>fn <a href='../../std/cmp/trait.Ord.html#tymethod.cmp' class='fnname'>cmp</a>(&amp;self, __arg_0: &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></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></div><h3 class='impl'><span class='in-band'><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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/time/mod.rs.html#340-346' title='goto source code'>[src]</a></span></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'><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></h4>
<div class='docblock'><p>The method for the <code>+</code> operator</p>
</div></div><h3 class='impl'><span class='in-band'><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></span><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/mod.rs.html#349-353' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.add_assign' class="method"><span id='add_assign.v' class='invisible'><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></h4>
<div class='docblock'><p>The method for the <code>+=</code> operator</p>
</div></div><h3 class='impl'><span class='in-band'><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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/time/mod.rs.html#356-362' title='goto source code'>[src]</a></span></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'><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></h4>
<div class='docblock'><p>The method for the <code>-</code> operator</p>
</div></div><h3 class='impl'><span class='in-band'><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></span><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/mod.rs.html#365-369' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.sub_assign' class="method"><span id='sub_assign.v' class='invisible'><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></h4>
<div class='docblock'><p>The method for the <code>-=</code> operator</p>
</div></div><h3 class='impl'><span class='in-band'><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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/time/mod.rs.html#372-376' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.fmt' class="method"><span id='fmt.v' class='invisible'><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></h4>
<div class='docblock'><p>Formats the value using the given formatter.</p>
</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>?</dt>
                    <dd>Show this help dialog</dd>
                    <dt>S</dt>
                    <dd>Focus the search field</dd>
                    <dt>&larrb;</dt>
                    <dd>Move up in search results</dd>
                    <dt>&rarrb;</dt>
                    <dd>Move down in search results</dd>
                    <dt>&#9166;</dt>
                    <dd>Go to active search result</dd>
                    <dt>+</dt>
                    <dd>Collapse/expand all sections</dd>
                </dl>
            </div>

            <div class="infos">
                <h2>Search Tricks</h2>

                <p>
                    Prefix searches with a type followed by a colon (e.g.
                    <code>fn:</code>) to restrict the search to a given type.
                </p>

                <p>
                    Accepted types are: <code>fn</code>, <code>mod</code>,
                    <code>struct</code>, <code>enum</code>,
                    <code>trait</code>, <code>type</code>, <code>macro</code>,
                    and <code>const</code>.
                </p>

                <p>
                    Search functions by type signature (e.g.
                    <code>vec -> usize</code> or <code>* -> vec</code>)
                </p>
            </div>
        </div>
    </aside>

    

    <script>
        window.rootPath = "../../";
        window.currentCrate = "std";
    </script>
    <script src="../../main.js"></script>
    <script defer src="../../search-index.js"></script>
</body>
</html>