title: Is there any way to restrict a generic type to one of several types?
body: <p>I'm trying to create a generic struct which uses an "integer type" for references into an array. For performance reasons I'd like to be able to specify easily whether to use <code>u16</code>, <code>u32</code> or <code>u64</code>. Something like this (which obviously isn't valid Rust code):</p>
  
  <pre><code>struct Foo&lt;T: u16 or u32 or u64&gt; { ... }
  </code></pre>
  
  <p>Is there any way to express this?</p>