Skip to content

impl AsyncBufRead for Decoder #289

@DrewMcArthur

Description

@DrewMcArthur

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions