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§
- Body
Stream 🔒 - Body
Stream Error - 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§
- Decoder
Type 🔒 - Inner 🔒
Constants§
Functions§
- map_
decode_ error - Normalize errors produced by the decompressors to
ErrorKind::InvalidDataso thathttp_loaderreports them asNetworkError::DecompressionError.