title: In Rust, is there a way to iterate through the values of an enum?
body: <p>I come from a Java background and I might have something like <code>enum Direction { NORTH, SOUTH, EAST, WEST}</code> and I could do something with each of the values in turn with the enhanced for loop like:</p>
  
  <pre class="lang-java prettyprint-override"><code>for(Direction dir : Direction.values())  {
      //do something with dir
  }
  </code></pre>
  
  <p>I would like to do a similar thing with Rust enums.</p>