pub struct HuffmanDecoder<'a> { /* private fields */ }Expand description
Huffman bitstream decoder.
Decodes symbols from a bitstream using a Huffman table.
Implementations§
Source§impl<'a> HuffmanDecoder<'a>
impl<'a> HuffmanDecoder<'a>
Sourcepub fn new(table: &'a HuffmanTable) -> Self
pub fn new(table: &'a HuffmanTable) -> Self
Create a new Huffman decoder with the given table.
Sourcepub fn decode_symbol(&self, bits: &mut BitReader<'_>) -> Result<u8>
pub fn decode_symbol(&self, bits: &mut BitReader<'_>) -> Result<u8>
Decode a single symbol from the bitstream.
Peeks max_bits, looks up the entry, and consumes the actual code bits. Uses zero-padded peek for end-of-stream handling (Zstd has implicit zeros).
Sourcepub fn table(&self) -> &HuffmanTable
pub fn table(&self) -> &HuffmanTable
Get the underlying table.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for HuffmanDecoder<'a>
impl<'a> RefUnwindSafe for HuffmanDecoder<'a>
impl<'a> Send for HuffmanDecoder<'a>
impl<'a> Sync for HuffmanDecoder<'a>
impl<'a> Unpin for HuffmanDecoder<'a>
impl<'a> UnwindSafe for HuffmanDecoder<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more