title: How do I print variables in Rust and have it show everything about that variable, like Ruby's .inspect?
body: <pre><code>use std::collections::HashMap;
  
  fn main() {
      let mut hash = HashMap::new();
      hash.insert("Daniel", "798-1364");
      println!("{}", hash);
  }
  </code></pre>
  
  <p>will fail to compile:</p>
  
  <pre class="lang-none prettyprint-override"><code>error[E0277]: `std::collections::HashMap&lt;&amp;str, &amp;str&gt;` doesn't implement `std::fmt::Display`
   --&gt; src/main.rs:6:20
    |
  6 |     println!("{}", hash);
    |                    ^^^^ `std::collections::HashMap&lt;&amp;str, &amp;str&gt;` cannot be formatted with the default formatter
    |
  </code></pre>
  
  <p>Is there a way to say something like:</p>
  
  <pre><code>println!("{}", hash.inspect());
  </code></pre>
  
  <p>and have it print out:</p>
  
  <pre class="lang-none prettyprint-override"><code>1) "Daniel" =&gt; "798-1364"
  </code></pre>