Closed bonsairobo closed 11 months ago
It seems like this same problem applies to all different kinds of XzDecoder
. Using any of them in an async context requires that they implement both the async and non-async versions of the io traits. E.g. AsyncRead + Read
, AsyncWrite + Write
, etc. I'm not aware of anything that implements both of these traits at the same time.
Huh now I see this: https://github.com/alexcrichton/xz2-rs/pull/109
I guess I will give async-compression a try.
https://github.com/alexcrichton/xz2-rs/blob/1a82c40d6d80171b7df328aea43b7054acd10c44/src/bufread.rs#L240C1-L241C59
I'm trying to figure out how to use
XzDecoder
with an async stream of bytes like you get fromreqwest::Response::bytes_stream()
. But I don't see how to transform the stream into something that implementsBufRead
. I don't really understand whyBufRead
is necessary in an async context either, where I would rather expectAsyncBufRead
.This is the closest I get:
But
tokio::io::BufReader
does not implementBufRead
.