Expand description
RFC 8878 Zstandard decoder.
Three entry points are exposed, each with progressively lower-level control:
StreamingDecoder— implementscrate::io::Readover a compressed byte stream, transparently parsing the frame header and concatenated frames. The typical choice for application code.FrameDecoder— single-frame interface; use when the caller manages the input buffer manually (zero-copy slices, network framing, etc).DictionaryHandle— pre-parsed dictionary handle. Parse the dictionary bytes once withDictionaryHandle::decode_dictand reuse the handle across every subsequent decode; saves the per-frame dictionary parse cost when the same dictionary is used many times in a row.
Both decoders expose dictionary-aware constructors / methods, though the exact naming differs:
StreamingDecoder::new_with_dictionary_handle/StreamingDecoder::new_with_dictionary_bytesFrameDecoder::decode_all_with_dict_handle/FrameDecoder::decode_all_with_dict_bytes
The _handle variants reuse a previously parsed
DictionaryHandle; the _bytes variants parse the dictionary
per call (suitable for one-off decodes).
Errors surface through errors::FrameDecoderError and the per-decoder
error types in the errors submodule.
Modules§
- errors
- Errors that might occur while decoding zstd formatted data
Structs§
- Dictionary
- Zstandard includes support for “raw content” dictionaries, that store bytes optionally used during sequence execution.
- Dictionary
Handle - Shared pre-parsed dictionary handle for repeated decoding.
- Frame
Decoder - Low level Zstandard decoder that can be used to decompress frames with fine control over when and how many bytes are decoded.
- Streaming
Decoder - High level Zstandard frame decoder that can be used to decompress a given Zstandard frame.