title: Implement fmt::Display for Vec<T>
body: <p>I want to implement the <code>fmt::Display</code> for a nested struct commonly used in my code.</p>
  
  <pre><code>// The root structure
  pub struct WhisperFile&lt;'a&gt; {
      pub path: &amp;'a str,
      pub handle: RefCell&lt;File&gt;,
      pub header: Header
  }
  
  pub struct Header{
      pub metadata: metadata::Metadata,
      pub archive_infos: Vec&lt;archive_info::ArchiveInfo&gt;
  }
  
  pub struct Metadata {
     // SNIP
  }
  
  pub struct ArchiveInfo {
     // SNIP
  }
  </code></pre>
  
  <p>As you can see, this is a non-trivial tree of data. The <code>archive_infos</code> property on <code>Header</code> can be quite long when presented as one line.</p>
  
  <p>I would like to emit something along the lines of</p>
  
  <pre><code>WhisperFile ({PATH})
    Metadata
      ...
    ArchiveInfo (0)
      ...
    ArchiveInfo (N)
      ...
  </code></pre>
  
  <p>But when I try to display <code>Vec&lt;ArchiveInfo&gt;</code> I get that Display is not implemented. I can implement <code>fmt::Display</code> for <code>ArchiveInfo</code> but that's not enough since <code>fmt::Display</code> is not implemented for the parent container <code>Vec</code>. If I implement fmt::Display for <code>collections::vec::Vec&lt;ArchiveInfo&gt;</code> I get <code>the impl does not reference any types defined in this crate; only traits defined in the current crate can be implemented for arbitrary types</code>.</p>
  
  <p>I have tried iterating over the vec and calling <code>write!()</code> but I couldn't figure out what the control flow should look like. I think <code>write!()</code> needs to be return value of the function but that breaks down with multiple calls.</p>
  
  <p>How can I pretty print a Vec of my structures?</p>