__compress only.Expand description
Streaming compression and decompression of HTTP bodies.
Decoder decompresses a payload stream using a given content encoding or the
Content-Encoding header. Encoder compresses a response body and updates its response head.
The caller is responsible for choosing a response encoding acceptable to the client.
§Supported Encodings
Supports a subset of the encodings in the IANA HTTP Content Coding Registry. Codec support is controlled by crate features:
compress-brotli: Brotli (br).compress-gzip: Gzip (gzip) and zlib-wrapped DEFLATE (deflate).compress-zstd: Zstandard (zstd).
This module is available when at least one of these features is enabled. Identity encoding and encodings whose feature is disabled pass through without compression or decompression.
§Streaming
Bodies are processed as they are polled. Output chunk boundaries can differ from input chunk boundaries. Larger chunks are processed on Tokio’s blocking thread pool, so poll these adapters within a Tokio runtime.