title: Crossbeam Receiver to BufRead?
body: <p>I receive a long string (several gigabytes) as chunks of <code>[u8]</code>s in a <a href="https://docs.rs/crossbeam/latest/crossbeam/channel/index.html" rel="nofollow noreferrer">Crossbeam channel</a>. I want to break it down to lines. How do I turn these chunks into a <code>BufRead</code>?</p>
  <pre class="lang-rust prettyprint-override"><code>fn foo(recv: crossbeam_channel::Receiver&lt;Vec&lt;u8&gt;&gt;) {
      let mut buf_read: dyn std::io::BufRead = WHAT_COMES_HERE(recv); // &lt;----
      for line in buf_read.lines() { 
          // ... 
      }
  }
  </code></pre>
  <p>I make these chunks on another thread since they are CPU-intensive to make. I could use something else than <code>Vec&lt;u8&gt;</code> if it makes more sense.</p>