Skip to main content

Module compression

Module compression 

Source
Expand description

Bounded decompression into a caller-reused result buffer. This convenience API accepts a complete encoded body; wire body streaming is exposed by the codecs.

Structs§

DecodeStep
A single incremental decode step. Retain input after consumed, and consume output before calling again. A single coding stages nothing internally; a chain stages between its codings in buffers allocated at construction.
StreamingDecoder
Incremental decoder for a Content-Encoding value: one coding, or a list of them applied in order (see StreamingDecoder::from_codings).

Constants§

MAX_CODINGS
Content codings one decoder accepts in a chain. A list is attacker-chosen and every coding adds state and a staging buffer; undici stops at five as well.

Functions§

decode
Convenience whole-body decode. Cache StreamingDecoder and use reset for allocation-free repeated responses instead of constructing one per call.