title: Equivalent of specific template usage in C++ for Rust
body: <p>Is there a feature in Rust that makes something like this possible?
  As far as I know, this is not possible with Rust's generic functions because they work only with data types and not with values.</p>
  
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;iostream&gt;
  
  template&lt;int T&gt;
  int foo(int a)
  {
    return -1;
  }
  template&lt;&gt;
  int foo&lt;2&gt;(int a)
  {
    return a*a;
  }
  template&lt;&gt;
  int foo&lt;3&gt;(int a)
  {
    return a*a*a;
  }
  
  int main()
  {
    std::cout &lt;&lt; "foo&lt;1&gt;(3): "&lt;&lt;foo&lt;1&gt;(3) &lt;&lt; std::endl;
    std::cout &lt;&lt; "foo&lt;2&gt;(3): "&lt;&lt;foo&lt;2&gt;(3) &lt;&lt; std::endl;
    std::cout &lt;&lt; "foo&lt;3&gt;(3): "&lt;&lt;foo&lt;3&gt;(3) &lt;&lt; std::endl;
    return 1;
  }
  </code></pre>
  
  <p>Result:</p>
  
  <pre class="lang-none prettyprint-override"><code>foo&lt;1&gt;(3): -1
  foo&lt;2&gt;(3): 9
  foo&lt;3&gt;(3): 27
  </code></pre>