Sophie

Sophie

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

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 `std`.">
    <meta name="keywords" content="rust, rustlang, rust-lang, Copy">

    <title>std::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='../../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'>Trait Copy</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#foreign-impls">Implementations on Foreign Types</a><div class="sidebar-links"><a href="#impl-Copy">NonZero&lt;T&gt;</a><a href="#impl-Copy">TryFromSliceError</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='../index.html'>std</a>::<wbr><a href='index.html'>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'>std</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="../../std/clone/trait.Clone.html" title="trait std::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='foreign-impls' class='small-section-header'>
                  Implementations on Foreign Types<a href='#foreign-impls' class='anchor'></a>
                </h2>
            <h3 id='impl-Copy' class='impl'><span class='in-band'><code>impl&lt;T&gt; <a class="trait" href="../../std/marker/trait.Copy.html" title="trait std::marker::Copy">Copy</a> for <a class="struct" href="../../core/nonzero/struct.NonZero.html" title="struct core::nonzero::NonZero">NonZero</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../core/nonzero/trait.Zeroable.html" title="trait core::nonzero::Zeroable">Zeroable</a> + <a class="trait" href="../../std/marker/trait.Copy.html" title="trait std::marker::Copy">Copy</a>,&nbsp;</span></code><a href='#impl-Copy' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/nonzero.rs.html#64' title='goto source code'>[src]</a></span></h3>
<span class='docblock autohide'><div class='impl-items'></div></span><h3 id='impl-Copy-1' 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="../../core/array/struct.TryFromSliceError.html" title="struct core::array::TryFromSliceError">TryFromSliceError</a></code><a href='#impl-Copy-1' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/array.rs.html#63' title='goto source code'>[src]</a></span></h3>
<span class='docblock autohide'><div class='impl-items'></div></span>
        <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/result.rs.html#253' title='goto source code'>[src]</a></div><code>impl&lt;T, E&gt; Copy for <a class="enum" href="../../std/result/enum.Result.html" title="enum std::result::Result">Result</a>&lt;T, E&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="../../std/marker/trait.Copy.html" title="trait std::marker::Copy">Copy</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/marker/trait.Copy.html" title="trait std::marker::Copy">Copy</a>,&nbsp;</span></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&gt; Copy for <a class="struct" href="../../std/ops/struct.RangeToInclusive.html" title="struct std::ops::RangeToInclusive">RangeToInclusive</a>&lt;Idx&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Idx: <a class="trait" href="../../std/marker/trait.Copy.html" title="trait std::marker::Copy">Copy</a>,&nbsp;</span></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="../../std/any/struct.TypeId.html" title="struct std::any::TypeId">TypeId</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="../../std/mem/struct.Discriminant.html" title="struct std::mem::Discriminant">Discriminant</a>&lt;T&gt;</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="../../std/str/struct.Utf8Error.html" title="struct std::str::Utf8Error">Utf8Error</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&gt; Copy for <a class="struct" href="../../std/ops/struct.RangeTo.html" title="struct std::ops::RangeTo">RangeTo</a>&lt;Idx&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Idx: <a class="trait" href="../../std/marker/trait.Copy.html" title="trait std::marker::Copy">Copy</a>,&nbsp;</span></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&gt; Copy for <a class="union" href="../../std/mem/union.ManuallyDrop.html" title="union std::mem::ManuallyDrop">ManuallyDrop</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/marker/trait.Copy.html" title="trait std::marker::Copy">Copy</a>,&nbsp;</span></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&gt; Copy for <a class="struct" href="../../std/ptr/struct.NonNull.html" title="struct std::ptr::NonNull">NonNull</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></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="../../std/convert/enum.Infallible.html" title="enum std::convert::Infallible">Infallible</a></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="../../std/str/pattern/enum.SearchStep.html" title="enum std::str::pattern::SearchStep">SearchStep</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="../../std/num/struct.TryFromIntError.html" title="struct std::num::TryFromIntError">TryFromIntError</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&gt; Copy for <a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/marker/trait.Copy.html" title="trait std::marker::Copy">Copy</a>,&nbsp;</span></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="../../std/num/enum.FpCategory.html" title="enum std::num::FpCategory">FpCategory</a></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, R&gt; Copy for <a class="enum" href="../../std/ops/enum.GeneratorState.html" title="enum std::ops::GeneratorState">GeneratorState</a>&lt;Y, R&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;R: <a class="trait" href="../../std/marker/trait.Copy.html" title="trait std::marker::Copy">Copy</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;Y: <a class="trait" href="../../std/marker/trait.Copy.html" title="trait std::marker::Copy">Copy</a>,&nbsp;</span></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="../../std/raw/struct.TraitObject.html" title="struct std::raw::TraitObject">TraitObject</a></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&gt; Copy for <a class="struct" href="../../std/ptr/struct.Unique.html" title="struct std::ptr::Unique">Unique</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></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="../../std/time/struct.Duration.html" title="struct std::time::Duration">Duration</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="../../std/fmt/struct.Arguments.html" title="struct std::fmt::Arguments">Arguments</a>&lt;'a&gt;</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="../../std/char/struct.CharTryFromError.html" title="struct std::char::CharTryFromError">CharTryFromError</a></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&gt; Copy for <a class="struct" href="../../std/marker/struct.PhantomData.html" title="struct std::marker::PhantomData">PhantomData</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></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 std::sync::atomic::<a class="enum" href="../../std/sync/atomic/enum.Ordering.html" title="enum std::sync::atomic::Ordering">Ordering</a></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="../../std/option/struct.NoneError.html" title="struct std::option::NoneError">NoneError</a></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="../../std/ops/struct.RangeFull.html" title="struct std::ops::RangeFull">RangeFull</a></code></li>
<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&gt; Copy for <a class="struct" href="../../std/num/struct.Wrapping.html" title="struct std::num::Wrapping">Wrapping</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/marker/trait.Copy.html" title="trait std::marker::Copy">Copy</a>,&nbsp;</span></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 std::cmp::<a class="enum" href="../../std/cmp/enum.Ordering.html" title="enum std::cmp::Ordering">Ordering</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="../../std/fmt/struct.Error.html" title="struct std::fmt::Error">Error</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/alloc/boxed.rs.html#101' title='goto source code'>[src]</a></div><code>impl Copy for <a class="struct" href="../../std/boxed/struct.ExchangeHeapSingleton.html" title="struct std::boxed::ExchangeHeapSingleton">ExchangeHeapSingleton</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/alloc/string.rs.html#1972' title='goto source code'>[src]</a></div><code>impl Copy for <a class="enum" href="../../std/string/enum.ParseError.html" title="enum std::string::ParseError">ParseError</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/alloc/heap.rs.html#77' title='goto source code'>[src]</a></div><code>impl Copy for <a class="struct" href="../../std/heap/struct.Heap.html" title="struct std::heap::Heap">Heap</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/alloc/lib.rs.html#245' title='goto source code'>[src]</a></div><code>impl&lt;T&gt; Copy for <a class="enum" href="../../std/collections/enum.Bound.html" title="enum std::collections::Bound">Bound</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/marker/trait.Copy.html" title="trait std::marker::Copy">Copy</a>,&nbsp;</span></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std_unicode/version.rs.html#14' title='goto source code'>[src]</a></div><code>impl Copy for <a class="struct" href="../../std/char/struct.UnicodeVersion.html" title="struct std::char::UnicodeVersion">UnicodeVersion</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/thread/local.rs.html#202' title='goto source code'>[src]</a></div><code>impl Copy for <a class="enum" href="../../std/thread/enum.LocalKeyState.html" title="enum std::thread::LocalKeyState">LocalKeyState</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/thread/mod.rs.html#925' title='goto source code'>[src]</a></div><code>impl Copy for <a class="struct" href="../../std/thread/struct.ThreadId.html" title="struct std::thread::ThreadId">ThreadId</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/fs.rs.html#201' title='goto source code'>[src]</a></div><code>impl Copy for <a class="struct" href="../../std/fs/struct.FileType.html" title="struct std::fs::FileType">FileType</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/io/error.rs.html#97' title='goto source code'>[src]</a></div><code>impl Copy for <a class="enum" href="../../std/io/enum.ErrorKind.html" title="enum std::io::ErrorKind">ErrorKind</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/io/mod.rs.html#1259' title='goto source code'>[src]</a></div><code>impl Copy for <a class="enum" href="../../std/io/enum.SeekFrom.html" title="enum std::io::SeekFrom">SeekFrom</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/net/ip.rs.html#47' title='goto source code'>[src]</a></div><code>impl Copy for <a class="enum" href="../../std/net/enum.IpAddr.html" title="enum std::net::IpAddr">IpAddr</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/net/ip.rs.html#83' title='goto source code'>[src]</a></div><code>impl Copy for <a class="struct" href="../../std/net/struct.Ipv4Addr.html" title="struct std::net::Ipv4Addr">Ipv4Addr</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/net/ip.rs.html#118' title='goto source code'>[src]</a></div><code>impl Copy for <a class="struct" href="../../std/net/struct.Ipv6Addr.html" title="struct std::net::Ipv6Addr">Ipv6Addr</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/net/ip.rs.html#125' title='goto source code'>[src]</a></div><code>impl Copy for <a class="enum" href="../../std/net/enum.Ipv6MulticastScope.html" title="enum std::net::Ipv6MulticastScope">Ipv6MulticastScope</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/net/addr.rs.html#46' title='goto source code'>[src]</a></div><code>impl Copy for <a class="enum" href="../../std/net/enum.SocketAddr.html" title="enum std::net::SocketAddr">SocketAddr</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/net/addr.rs.html#79' title='goto source code'>[src]</a></div><code>impl Copy for <a class="struct" href="../../std/net/struct.SocketAddrV4.html" title="struct std::net::SocketAddrV4">SocketAddrV4</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/net/addr.rs.html#106' title='goto source code'>[src]</a></div><code>impl Copy for <a class="struct" href="../../std/net/struct.SocketAddrV6.html" title="struct std::net::SocketAddrV6">SocketAddrV6</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/net/mod.rs.html#69' title='goto source code'>[src]</a></div><code>impl Copy for <a class="enum" href="../../std/net/enum.Shutdown.html" title="enum std::net::Shutdown">Shutdown</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/path.rs.html#146' title='goto source code'>[src]</a></div><code>impl&lt;'a&gt; Copy for <a class="enum" href="../../std/path/enum.Prefix.html" title="enum std::path::Prefix">Prefix</a>&lt;'a&gt;</code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/path.rs.html#424' title='goto source code'>[src]</a></div><code>impl&lt;'a&gt; Copy for <a class="struct" href="../../std/path/struct.PrefixComponent.html" title="struct std::path::PrefixComponent">PrefixComponent</a>&lt;'a&gt;</code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/path.rs.html#508' title='goto source code'>[src]</a></div><code>impl&lt;'a&gt; Copy for <a class="enum" href="../../std/path/enum.Component.html" title="enum std::path::Component">Component</a>&lt;'a&gt;</code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/process.rs.html#1010' title='goto source code'>[src]</a></div><code>impl Copy for <a class="struct" href="../../std/process/struct.ExitStatus.html" title="struct std::process::ExitStatus">ExitStatus</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/sync/mpsc/mod.rs.html#568' title='goto source code'>[src]</a></div><code>impl&lt;T:&nbsp;<a class="trait" href="../../std/marker/trait.Copy.html" title="trait std::marker::Copy">Copy</a>&gt; Copy for <a class="struct" href="../../std/sync/mpsc/struct.SendError.html" title="struct std::sync::mpsc::SendError">SendError</a>&lt;T&gt;</code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/sync/mpsc/mod.rs.html#581' title='goto source code'>[src]</a></div><code>impl Copy for <a class="struct" href="../../std/sync/mpsc/struct.RecvError.html" title="struct std::sync::mpsc::RecvError">RecvError</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/sync/mpsc/mod.rs.html#592' title='goto source code'>[src]</a></div><code>impl Copy for <a class="enum" href="../../std/sync/mpsc/enum.TryRecvError.html" title="enum std::sync::mpsc::TryRecvError">TryRecvError</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/sync/mpsc/mod.rs.html#613' title='goto source code'>[src]</a></div><code>impl Copy for <a class="enum" href="../../std/sync/mpsc/enum.RecvTimeoutError.html" title="enum std::sync::mpsc::RecvTimeoutError">RecvTimeoutError</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/sync/mpsc/mod.rs.html#631' title='goto source code'>[src]</a></div><code>impl&lt;T:&nbsp;<a class="trait" href="../../std/marker/trait.Copy.html" title="trait std::marker::Copy">Copy</a>&gt; Copy for <a class="enum" href="../../std/sync/mpsc/enum.TrySendError.html" title="enum std::sync::mpsc::TrySendError">TrySendError</a>&lt;T&gt;</code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/sync/condvar.rs.html#25' title='goto source code'>[src]</a></div><code>impl Copy for <a class="struct" href="../../std/sync/struct.WaitTimeoutResult.html" title="struct std::sync::WaitTimeoutResult">WaitTimeoutResult</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/time.rs.html#67' title='goto source code'>[src]</a></div><code>impl Copy for <a class="struct" href="../../std/time/struct.Instant.html" title="struct std::time::Instant">Instant</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/time.rs.html#119' title='goto source code'>[src]</a></div><code>impl Copy for <a class="struct" href="../../std/time/struct.SystemTime.html" title="struct std::time::SystemTime">SystemTime</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 = "std";
    </script>
    <script src="../../main.js"></script>
    <script defer src="../../search-index.js"></script>
</body>
</html>