#[non_exhaustive]#[repr(u8)]pub enum CodecId {
Store = 0,
Deflate = 1,
Lz4 = 2,
Snappy = 3,
Zstd = 4,
Lzma = 5,
}Expand description
Names the compression applied to an entry’s payload.
Stored in the low nibble of an entry’s first byte, so the format admits
at most sixteen codecs and every id below is permanently assigned. Which
of them a given build can actually use is a separate question, decided
by embark-codec’s cargo features: an id naming a codec that was not
compiled in parses fine here and fails at decompression time with
Error::UnknownCodec.
#[non_exhaustive]: this list has already grown from two variants to
six and the format has room for ten more, so match it with a wildcard
arm that reports Error::UnknownCodec rather than one that silently
picks a default.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Store = 0
No compression: the payload is the original bytes verbatim.
Also the fallback the build-time encoders pick whenever the chosen codec would have made the file larger.
Deflate = 1
Raw DEFLATE (RFC 1951), with no zlib or gzip wrapper.
Lz4 = 2
LZ4 block format, without the frame header.
Snappy = 3
Snappy block format, including its length preamble.
Zstd = 4
Zstandard, as a complete single-frame stream.
Lzma = 5
LZMA1 in the .lzma “alone” container, header included.