Expand description
Trained-dictionary zstd compression for PJS byte-level transport (Layer B).
Provides ZstdDictionary (a validated opaque blob carrying the libzstd
dictionary) and ZstdDictCompressor (a stateless driver for training,
compression, and standalone decompression).
The hot-path decompression used by crate::compression::secure::SecureCompressor
is intentionally not exposed here: it uses a streaming decoder routed
through CompressionBombProtector so the output-size guard still applies.
This module’s decompress is only for callers that need a standalone,
non-bomb-protected path (e.g., tests or tools where the size is already known).
Available only when feature = "compression" is enabled and the target is
not wasm32.
Structs§
- Zstd
Dict Compressor - Stateless driver for zstd dictionary operations.
- Zstd
Dictionary - A validated, size-bounded zstd dictionary blob.
Constants§
- DEFAULT_
LEVEL - Default zstd compression level used by
ZstdDictCompressor::compress. - MAX_
DICT_ SIZE - Maximum permitted dictionary size in bytes (112 KiB).
- N_TRAIN
- Number of training samples required before
ZstdDictCompressor::trainis called. Libzstd requires at least 8 samples;N_TRAINis set to 32 so the resulting dictionary captures representative variance across a session. Below this thresholdcrate::domain::ports::dictionary_store::DictionaryStore::get_dictionaryreturnsOk(None).