Expand description
Shared trait wrappers for the source-coding implementations in this crate.
The individual modules such as crate::lz77, crate::lz78, and
crate::lzw intentionally expose plain function-based APIs because that
keeps each algorithm easy to read in isolation. This module adds a thin
trait layer on top so generic code can work with any of those codecs
through one unified interface.
§Design
The trait uses associated functions rather than instance methods because the current codecs are stateless. Each implementation is represented by a zero-sized wrapper type that simply forwards to the existing module-level functions.
See the book entry Entropy coding.
Structs§
- Arithmetic
Source Coder - Zero-sized wrapper for the arithmetic coding implementation.
- Huffman
Source Coder - Zero-sized wrapper for the Huffman implementation.
- Lz77
Source Coder - Zero-sized wrapper for the sliding-window LZ77 implementation.
- Lz78
Source Coder - Zero-sized wrapper for the explicit-dictionary LZ78 implementation.
- LzwSource
Coder - Zero-sized wrapper for the Welch-style LZW implementation.
- Shannon
Fano Source Coder - Zero-sized wrapper for the Shannon-Fano implementation.
Traits§
- Source
Coder - Common interface for byte-oriented source coders in this crate.