You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! So I've got a stream: impl AsyncBufRead, which may or may not be gzipped. I'm trying to return that stream in a function whose return type is Result<impl AsyncBufRead, Error>, but running into the issue where the GzipDecoder is AsyncRead, but not AsyncBufRead. Since the inner reader it pulls from is AsyncBufRead, is there any reason why the decoder itself can't be AsyncBufRead?
Or, am I misreading the docs, and I should just be calling into_inner()? the way I read it currently, this returns the original stream though, not the decoded version.
If it's easier, I just need this for the GzipDecoder, but I assume this level would be generic across all the Decoders.
The text was updated successfully, but these errors were encountered:
update: I was able to update my function to return a Box<dyn AsyncRead>, which covers both the GZipped case (returning a GzipDecoder: AsyncRead) and the plain filestream from S3 (returning an impl AsyncBufRead, which also is AsyncRead). Since my parsing function downstream just needs a Stream<Item=Bytes>, that's all I needed.
I'm still very curious what it would take to implement AsyncBufRead for the Decoder. I tried messing around with it a bit last night, but I'm too unfamiliar with Pins and all of that.
Hi! So I've got a
stream: impl AsyncBufRead
, which may or may not be gzipped. I'm trying to return that stream in a function whose return type isResult<impl AsyncBufRead, Error>
, but running into the issue where theGzipDecoder
isAsyncRead
, but notAsyncBufRead
. Since theinner
reader it pulls from isAsyncBufRead
, is there any reason why the decoder itself can't beAsyncBufRead
?Or, am I misreading the docs, and I should just be calling
into_inner()
? the way I read it currently, this returns the original stream though, not the decoded version.If it's easier, I just need this for the
GzipDecoder
, but I assume this level would be generic across all theDecoder
s.The text was updated successfully, but these errors were encountered: