Create an [`AsyncZstdReader`] that incrementally decompresses the data fed to it via the returned [`mpsc::UnboundedSender`]. The reader implements [`tokio::io::AsyncRead`] and will indicate EOF once the sender is dropped and all remaining data in the channel has been consumed.
()
| 622 | /// once the sender is dropped and all remaining data in the channel has been |
| 623 | /// consumed. |
| 624 | fn zstd_reader() -> io::Result<( |
| 625 | AsyncZstdReader<'static, impl AsyncBufRead>, |
| 626 | mpsc::UnboundedSender<Bytes>, |
| 627 | )> { |
| 628 | let (tx, rx) = mpsc::unbounded_channel::<Bytes>(); |
| 629 | let reader = StreamReader::new(UnboundedReceiverStream::new(rx).map(Ok::<_, io::Error>)); |
| 630 | let zstd = AsyncZstdReader::builder_tokio(reader).build()?; |
| 631 | |
| 632 | Ok((zstd, tx)) |
| 633 | } |
| 634 | |
| 635 | /// Newtype around [`blake3::Hasher`] |
| 636 | /// that implements [`AsyncWrite`] and [`SatsWriter`]. |
no test coverage detected
searching dependent graphs…