Skip to main content

Codec

Trait Codec 

Source
pub trait Codec: Sealed {
    const ID: CodecId;
}
Expand description

Associates a built-in codec type with its on-binary CodecId.

This trait is sealed and cannot be implemented outside this crate. The codec id is a fixed four-bit field of the embedded entry header with no values left over, so there is no id a downstream codec could claim and no path by which the derive macros or crate::decompress could reach one. Compression itself lives on inherent methods of each codec type, so calling Deflate.compress(..) does not require this trait in scope.

Required Associated Constants§

Source

const ID: CodecId

The on-binary CodecId this codec corresponds to.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Codec for Deflate

Available on crate feature deflate only.
Source§

const ID: CodecId = CodecId::Deflate

Source§

impl Codec for Lz4

Available on crate feature lz4 only.
Source§

const ID: CodecId = CodecId::Lz4

Source§

impl Codec for Lzma

Available on crate feature lzma only.
Source§

const ID: CodecId = CodecId::Lzma

Source§

impl Codec for Snappy

Available on crate feature snappy only.
Source§

const ID: CodecId = CodecId::Snappy

Source§

impl Codec for Store

Source§

const ID: CodecId = CodecId::Store

Source§

impl Codec for Zstd

Available on crate feature zstd only.
Source§

const ID: CodecId = CodecId::Zstd