Sophie

Sophie

distrib > Mageia > 6 > x86_64 > media > core-updates > by-pkgid > fdedb3cf2140df9b6d419a2338ab1caa > files > 1696

rust-doc-1.25.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 `Copy` trait in crate `core`.">
    <meta name="keywords" content="rust, rustlang, rust-lang, Copy">

    <title>core::marker::Copy - 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="../../main.css" id="themeStyle">
    <script src="../../storage.js"></script>
    

    <link rel="shortcut icon" href="https://doc.rust-lang.org/favicon.ico">
    
</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='../../core/index.html'><img src='https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png' alt='logo' width='100'></a>
        <p class='location'>Trait Copy</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='../index.html'>core</a>::<wbr><a href='index.html'>marker</a></p><script>window.sidebarCurrent = {name: 'Copy', 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="../../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">
            </div>
        </form>
    </nav>

    <section id='main' class="content">
<h1 class='fqn'><span class='in-band'>Trait <a href='../index.html'>core</a>::<wbr><a href='index.html'>marker</a>::<wbr><a class="trait" href=''>Copy</a></span><span class='out-of-band'><span class='since' title='Stable since Rust version 1.0.0'>1.0.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/core/marker.rs.html#268-270' title='goto source code'>[src]</a></span></h1>
<pre class='rust trait'><div class="docblock attributes">#[lang = "copy"]
</div>pub trait Copy: <a class="trait" href="../../core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> { }</pre><div class='docblock'><p>Types whose values can be duplicated simply by copying bits.</p>
<p>By default, variable bindings have 'move semantics.' In other
words:</p>

<pre class="rust rust-example-rendered">
<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>)]</span>
<span class="kw">struct</span> <span class="ident">Foo</span>;

<span class="kw">let</span> <span class="ident">x</span> <span class="op">=</span> <span class="ident">Foo</span>;

<span class="kw">let</span> <span class="ident">y</span> <span class="op">=</span> <span class="ident">x</span>;

<span class="comment">// `x` has moved into `y`, and so cannot be used</span>

<span class="comment">// println!(&quot;{:?}&quot;, x); // error: use of moved value</span><a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0A%23%5Bderive(Debug)%5D%0Astruct%20Foo%3B%0A%0Alet%20x%20%3D%20Foo%3B%0A%0Alet%20y%20%3D%20x%3B%0A%0A%2F%2F%20%60x%60%20has%20moved%20into%20%60y%60%2C%20and%20so%20cannot%20be%20used%0A%0A%2F%2F%20println!(%22%7B%3A%3F%7D%22%2C%20x)%3B%20%2F%2F%20error%3A%20use%20of%20moved%20value%0A%7D">Run</a></pre>
<p>However, if a type implements <code>Copy</code>, it instead has 'copy semantics':</p>

<pre class="rust rust-example-rendered">
<span class="comment">// We can derive a `Copy` implementation. `Clone` is also required, as it&#39;s</span>
<span class="comment">// a supertrait of `Copy`.</span>
<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Copy</span>, <span class="ident">Clone</span>)]</span>
<span class="kw">struct</span> <span class="ident">Foo</span>;

<span class="kw">let</span> <span class="ident">x</span> <span class="op">=</span> <span class="ident">Foo</span>;

<span class="kw">let</span> <span class="ident">y</span> <span class="op">=</span> <span class="ident">x</span>;

<span class="comment">// `y` is a copy of `x`</span>

<span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;{:?}&quot;</span>, <span class="ident">x</span>); <span class="comment">// A-OK!</span><a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0A%2F%2F%20We%20can%20derive%20a%20%60Copy%60%20implementation.%20%60Clone%60%20is%20also%20required%2C%20as%20it's%0A%2F%2F%20a%20supertrait%20of%20%60Copy%60.%0A%23%5Bderive(Debug%2C%20Copy%2C%20Clone)%5D%0Astruct%20Foo%3B%0A%0Alet%20x%20%3D%20Foo%3B%0A%0Alet%20y%20%3D%20x%3B%0A%0A%2F%2F%20%60y%60%20is%20a%20copy%20of%20%60x%60%0A%0Aprintln!(%22%7B%3A%3F%7D%22%2C%20x)%3B%20%2F%2F%20A-OK!%0A%7D">Run</a></pre>
<p>It's important to note that in these two examples, the only difference is whether you
are allowed to access <code>x</code> after the assignment. Under the hood, both a copy and a move
can result in bits being copied in memory, although this is sometimes optimized away.</p>
<h2 id="how-can-i-implement-copy" class="section-header"><a href="#how-can-i-implement-copy">How can I implement <code>Copy</code>?</a></h2>
<p>There are two ways to implement <code>Copy</code> on your type. The simplest is to use <code>derive</code>:</p>

<pre class="rust rust-example-rendered">
<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Copy</span>, <span class="ident">Clone</span>)]</span>
<span class="kw">struct</span> <span class="ident">MyStruct</span>;<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0A%23%5Bderive(Copy%2C%20Clone)%5D%0Astruct%20MyStruct%3B%0A%7D">Run</a></pre>
<p>You can also implement <code>Copy</code> and <code>Clone</code> manually:</p>

<pre class="rust rust-example-rendered">
<span class="kw">struct</span> <span class="ident">MyStruct</span>;

<span class="kw">impl</span> <span class="ident">Copy</span> <span class="kw">for</span> <span class="ident">MyStruct</span> { }

<span class="kw">impl</span> <span class="ident">Clone</span> <span class="kw">for</span> <span class="ident">MyStruct</span> {
    <span class="kw">fn</span> <span class="ident">clone</span>(<span class="kw-2">&amp;</span><span class="self">self</span>) <span class="op">-&gt;</span> <span class="ident">MyStruct</span> {
        <span class="kw-2">*</span><span class="self">self</span>
    }
}<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Astruct%20MyStruct%3B%0A%0Aimpl%20Copy%20for%20MyStruct%20%7B%20%7D%0A%0Aimpl%20Clone%20for%20MyStruct%20%7B%0A%20%20%20%20fn%20clone(%26self)%20-%3E%20MyStruct%20%7B%0A%20%20%20%20%20%20%20%20*self%0A%20%20%20%20%7D%0A%7D%0A%7D">Run</a></pre>
<p>There is a small difference between the two: the <code>derive</code> strategy will also place a <code>Copy</code>
bound on type parameters, which isn't always desired.</p>
<h2 id="whats-the-difference-between-copy-and-clone" class="section-header"><a href="#whats-the-difference-between-copy-and-clone">What's the difference between <code>Copy</code> and <code>Clone</code>?</a></h2>
<p>Copies happen implicitly, for example as part of an assignment <code>y = x</code>. The behavior of
<code>Copy</code> is not overloadable; it is always a simple bit-wise copy.</p>
<p>Cloning is an explicit action, <code>x.clone()</code>. The implementation of <a href="../clone/trait.Clone.html"><code>Clone</code></a> can
provide any type-specific behavior necessary to duplicate values safely. For example,
the implementation of <a href="../clone/trait.Clone.html"><code>Clone</code></a> for <a href="../../std/string/struct.String.html"><code>String</code></a> needs to copy the pointed-to string
buffer in the heap. A simple bitwise copy of <a href="../../std/string/struct.String.html"><code>String</code></a> values would merely copy the
pointer, leading to a double free down the line. For this reason, <a href="../../std/string/struct.String.html"><code>String</code></a> is <a href="../clone/trait.Clone.html"><code>Clone</code></a>
but not <code>Copy</code>.</p>
<p><a href="../clone/trait.Clone.html"><code>Clone</code></a> is a supertrait of <code>Copy</code>, so everything which is <code>Copy</code> must also implement
<a href="../clone/trait.Clone.html"><code>Clone</code></a>. If a type is <code>Copy</code> then its <a href="../clone/trait.Clone.html"><code>Clone</code></a> implementation only needs to return <code>*self</code>
(see the example above).</p>
<h2 id="when-can-my-type-be-copy" class="section-header"><a href="#when-can-my-type-be-copy">When can my type be <code>Copy</code>?</a></h2>
<p>A type can implement <code>Copy</code> if all of its components implement <code>Copy</code>. For example, this
struct can be <code>Copy</code>:</p>

<pre class="rust rust-example-rendered">
<span class="kw">struct</span> <span class="ident">Point</span> {
   <span class="ident">x</span>: <span class="ident">i32</span>,
   <span class="ident">y</span>: <span class="ident">i32</span>,
}<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0A%23%5Ballow(dead_code)%5D%0Astruct%20Point%20%7B%0A%20%20%20x%3A%20i32%2C%0A%20%20%20y%3A%20i32%2C%0A%7D%0A%7D">Run</a></pre>
<p>A struct can be <code>Copy</code>, and <a href="../../std/primitive.i32.html"><code>i32</code></a> is <code>Copy</code>, therefore <code>Point</code> is eligible to be <code>Copy</code>.
By contrast, consider</p>

<pre class="rust rust-example-rendered">
<span class="kw">struct</span> <span class="ident">PointList</span> {
    <span class="ident">points</span>: <span class="ident">Vec</span><span class="op">&lt;</span><span class="ident">Point</span><span class="op">&gt;</span>,
}<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0A%23!%5Ballow(dead_code)%5D%0Afn%20main()%20%7B%0Astruct%20Point%3B%0Astruct%20PointList%20%7B%0A%20%20%20%20points%3A%20Vec%3CPoint%3E%2C%0A%7D%0A%7D">Run</a></pre>
<p>The struct <code>PointList</code> cannot implement <code>Copy</code>, because <a href="../../std/vec/struct.Vec.html"><code>Vec&lt;T&gt;</code></a> is not <code>Copy</code>. If we
attempt to derive a <code>Copy</code> implementation, we'll get an error:</p>
<pre><code class="language-text">the trait `Copy` may not be implemented for this type; field `points` does not implement `Copy`
</code></pre>
<h2 id="when-cant-my-type-be-copy" class="section-header"><a href="#when-cant-my-type-be-copy">When <em>can't</em> my type be <code>Copy</code>?</a></h2>
<p>Some types can't be copied safely. For example, copying <code>&amp;mut T</code> would create an aliased
mutable reference. Copying <a href="../../std/string/struct.String.html"><code>String</code></a> would duplicate responsibility for managing the
<a href="../../std/string/struct.String.html"><code>String</code></a>'s buffer, leading to a double free.</p>
<p>Generalizing the latter case, any type implementing <a href="../../std/ops/trait.Drop.html"><code>Drop</code></a> can't be <code>Copy</code>, because it's
managing some resource besides its own <a href="../../std/mem/fn.size_of.html"><code>size_of::&lt;T&gt;</code></a> bytes.</p>
<p>If you try to implement <code>Copy</code> on a struct or enum containing non-<code>Copy</code> data, you will get
the error <a href="../../error-index.html#E0204">E0204</a>.</p>
<h2 id="when-should-my-type-be-copy" class="section-header"><a href="#when-should-my-type-be-copy">When <em>should</em> my type be <code>Copy</code>?</a></h2>
<p>Generally speaking, if your type <em>can</em> implement <code>Copy</code>, it should. Keep in mind, though,
that implementing <code>Copy</code> is part of the public API of your type. If the type might become
non-<code>Copy</code> in the future, it could be prudent to omit the <code>Copy</code> implementation now, to
avoid a breaking API change.</p>
</div>
        <h2 id='implementors' class='small-section-header'>
          Implementors<a href='#implementors' class='anchor'></a>
        </h2>
        <ul class='item-list' id='implementors-list'>
    <li><div class='out-of-band'><a class='srclink' href='../../src/core/num/mod.rs.html#45' title='goto source code'>[src]</a></div><code>impl&lt;T:&nbsp;<a class="trait" href="../../core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>&gt; Copy for <a class="struct" href="../../core/num/struct.Wrapping.html" title="struct core::num::Wrapping">Wrapping</a>&lt;T&gt;</code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/core/num/mod.rs.html#2853' title='goto source code'>[src]</a></div><code>impl Copy for <a class="enum" href="../../core/num/enum.FpCategory.html" title="enum core::num::FpCategory">FpCategory</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/core/num/mod.rs.html#2972' title='goto source code'>[src]</a></div><code>impl Copy for <a class="struct" href="../../core/num/struct.TryFromIntError.html" title="struct core::num::TryFromIntError">TryFromIntError</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/core/mem.rs.html#845' title='goto source code'>[src]</a></div><code>impl&lt;T&gt; Copy for <a class="struct" href="../../core/mem/struct.Discriminant.html" title="struct core::mem::Discriminant">Discriminant</a>&lt;T&gt;</code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/core/mem.rs.html#949' title='goto source code'>[src]</a></div><code>impl&lt;T:&nbsp;<a class="trait" href="../../core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>&gt; Copy for <a class="union" href="../../core/mem/union.ManuallyDrop.html" title="union core::mem::ManuallyDrop">ManuallyDrop</a>&lt;T&gt;</code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/core/nonzero.rs.html#64' title='goto source code'>[src]</a></div><code>impl&lt;T:&nbsp;<a class="trait" href="../../core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> + <a class="trait" href="../../core/nonzero/trait.Zeroable.html" title="trait core::nonzero::Zeroable">Zeroable</a>&gt; Copy for <a class="struct" href="../../core/nonzero/struct.NonZero.html" title="struct core::nonzero::NonZero">NonZero</a>&lt;T&gt;</code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/core/ptr.rs.html#2430' title='goto source code'>[src]</a></div><code>impl&lt;T:&nbsp;?<a class="trait" href="../../core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; Copy for <a class="struct" href="../../core/ptr/struct.Unique.html" title="struct core::ptr::Unique">Unique</a>&lt;T&gt;</code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/core/ptr.rs.html#2574' title='goto source code'>[src]</a></div><code>impl&lt;T:&nbsp;?<a class="trait" href="../../core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; Copy for <a class="struct" href="../../core/ptr/struct.NonNull.html" title="struct core::ptr::NonNull">NonNull</a>&lt;T&gt;</code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/core/marker.rs.html#387' title='goto source code'>[src]</a></div><code>impl&lt;T:&nbsp;?<a class="trait" href="../../core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; Copy for <a class="struct" href="../../core/marker/struct.PhantomData.html" title="struct core::marker::PhantomData">PhantomData</a>&lt;T&gt;</code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/core/ops/generator.rs.html#16' title='goto source code'>[src]</a></div><code>impl&lt;Y:&nbsp;<a class="trait" href="../../core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>, R:&nbsp;<a class="trait" href="../../core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>&gt; Copy for <a class="enum" href="../../core/ops/enum.GeneratorState.html" title="enum core::ops::GeneratorState">GeneratorState</a>&lt;Y, R&gt;</code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/core/ops/range.rs.html#48' title='goto source code'>[src]</a></div><code>impl Copy for <a class="struct" href="../../core/ops/struct.RangeFull.html" title="struct core::ops::RangeFull">RangeFull</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/core/ops/range.rs.html#211' title='goto source code'>[src]</a></div><code>impl&lt;Idx:&nbsp;<a class="trait" href="../../core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>&gt; Copy for <a class="struct" href="../../core/ops/struct.RangeTo.html" title="struct core::ops::RangeTo">RangeTo</a>&lt;Idx&gt;</code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/core/ops/range.rs.html#347' title='goto source code'>[src]</a></div><code>impl&lt;Idx:&nbsp;<a class="trait" href="../../core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>&gt; Copy for <a class="struct" href="../../core/ops/struct.RangeToInclusive.html" title="struct core::ops::RangeToInclusive">RangeToInclusive</a>&lt;Idx&gt;</code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/core/cmp.rs.html#205' title='goto source code'>[src]</a></div><code>impl Copy for core::cmp::<a class="enum" href="../../core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/core/convert.rs.html#60' title='goto source code'>[src]</a></div><code>impl Copy for <a class="enum" href="../../core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/core/any.rs.html#345' title='goto source code'>[src]</a></div><code>impl Copy for <a class="struct" href="../../core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/core/array.rs.html#63' title='goto source code'>[src]</a></div><code>impl Copy for <a class="struct" href="../../core/array/struct.TryFromSliceError.html" title="struct core::array::TryFromSliceError">TryFromSliceError</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/core/sync/atomic.rs.html#184' title='goto source code'>[src]</a></div><code>impl Copy for core::sync::atomic::<a class="enum" href="../../core/sync/atomic/enum.Ordering.html" title="enum core::sync::atomic::Ordering">Ordering</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/core/char.rs.html#284' title='goto source code'>[src]</a></div><code>impl Copy for <a class="struct" href="../../core/char/struct.CharTryFromError.html" title="struct core::char::CharTryFromError">CharTryFromError</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/core/option.rs.html#157' title='goto source code'>[src]</a></div><code>impl&lt;T:&nbsp;<a class="trait" href="../../core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>&gt; Copy for <a class="enum" href="../../core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;T&gt;</code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/core/option.rs.html#1210' title='goto source code'>[src]</a></div><code>impl Copy for <a class="struct" href="../../core/option/struct.NoneError.html" title="struct core::option::NoneError">NoneError</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/core/raw.rs.html#94' title='goto source code'>[src]</a></div><code>impl Copy for <a class="struct" href="../../core/raw/struct.TraitObject.html" title="struct core::raw::TraitObject">TraitObject</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/core/result.rs.html#253' title='goto source code'>[src]</a></div><code>impl&lt;T:&nbsp;<a class="trait" href="../../core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>, E:&nbsp;<a class="trait" href="../../core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>&gt; Copy for <a class="enum" href="../../core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, E&gt;</code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/core/str/pattern.rs.html#76' title='goto source code'>[src]</a></div><code>impl Copy for <a class="enum" href="../../core/str/pattern/enum.SearchStep.html" title="enum core::str::pattern::SearchStep">SearchStep</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/core/str/mod.rs.html#168' title='goto source code'>[src]</a></div><code>impl Copy for <a class="struct" href="../../core/str/struct.Utf8Error.html" title="struct core::str::Utf8Error">Utf8Error</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/core/fmt/mod.rs.html#104' title='goto source code'>[src]</a></div><code>impl Copy for <a class="struct" href="../../core/fmt/struct.Error.html" title="struct core::fmt::Error">Error</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/core/fmt/mod.rs.html#413' title='goto source code'>[src]</a></div><code>impl&lt;'a&gt; Copy for <a class="struct" href="../../core/fmt/struct.Arguments.html" title="struct core::fmt::Arguments">Arguments</a>&lt;'a&gt;</code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/core/time.rs.html#62' title='goto source code'>[src]</a></div><code>impl Copy for <a class="struct" href="../../core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a></code></li>
</ul><script type="text/javascript" async
                         src="../../implementors/core/marker/trait.Copy.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>
            </div>
        </div>
    </aside>

    

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