pub fn compression_from_attrs(
byte: i8,
) -> Result<CompressionType, LegacyRecordsError>Expand description
Map a v0/v1 compression code to a [CompressionType].
The compression code is the low 3 bits of attributes.
0 => None, 1 => Gzip, 2 => Snappy, 3 => Lz4. v0/v1
never carried Zstd on the wire. KIP-110 was v2-only.
ยงErrors
Returns LegacyRecordsError::Malformed if the compression code is not 0, 1, 2, or 3.