title: How can I implement Rust's Copy trait?
body: <p>I am trying to initialise an array of structs in Rust:</p>
  
  <pre><code>enum Direction {
      North,
      East,
      South,
      West,
  }
  
  struct RoadPoint {
      direction: Direction,
      index: i32,
  }
  
  // Initialise the array, but failed.
  let data = [RoadPoint { direction: Direction::East, index: 1 }; 4]; 
  </code></pre>
  
  <p>When I try to compile, the compiler complains that the <code>Copy</code> trait is not implemented:</p>
  
  <pre class="lang-none prettyprint-override"><code>error[E0277]: the trait bound `main::RoadPoint: std::marker::Copy` is not satisfied
    --&gt; src/main.rs:15:16
     |
  15 |     let data = [RoadPoint { direction: Direction::East, index: 1 }; 4]; 
     |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `main::RoadPoint`
     |
     = note: the `Copy` trait is required because the repeated element will be copied
  </code></pre>
  
  <p>How can the <code>Copy</code> trait be implemented?</p>