Skip to main content

Module decoder

Module decoder 

Source
Expand description

Adapted from an implementation in reqwest. A non-blocking response decoder.

The decoder wraps a stream of bytes and produces a new stream of decompressed bytes. The decompressed bytes aren’t guaranteed to align to the compressed ones.

If the response is plaintext then no additional work is carried out. Bytes are just passed along.

If the response is gzip, deflate or brotli then the bytes are decompressed.

Structs§

BodyStream 🔒
BodyStreamError
Marker wrapper for errors that originate from the network body stream
Decoder
A response decompressor over a non-blocking stream of bytes.
Pending 🔒
A future attempt to poll the response body for EOF so we know whether to use gzip or not.

Enums§

DecoderType 🔒
Inner 🔒

Constants§

DECODER_BUFFER_SIZE

Functions§

map_decode_error
Normalize errors produced by the decompressors to ErrorKind::InvalidData so that http_loader reports them as NetworkError::DecompressionError.