pub struct HuffmanTable { /* private fields */ }Expand description
Huffman decoding table.
Uses a single-level lookup table for fast decoding. Table size is 2^max_bits entries.
Implementations§
Source§impl HuffmanTable
impl HuffmanTable
Sourcepub fn from_weights(weights: &[u8]) -> Result<Self>
pub fn from_weights(weights: &[u8]) -> Result<Self>
Sourcepub fn num_symbols(&self) -> usize
pub fn num_symbols(&self) -> usize
Get the number of symbols.
Sourcepub fn decode(&self, index: usize) -> &HuffmanTableEntry
pub fn decode(&self, index: usize) -> &HuffmanTableEntry
Decode a symbol from the lookup index.
The index is formed by peeking max_bits from the bitstream.
Trait Implementations§
Source§impl Clone for HuffmanTable
impl Clone for HuffmanTable
Source§fn clone(&self) -> HuffmanTable
fn clone(&self) -> HuffmanTable
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for HuffmanTable
impl RefUnwindSafe for HuffmanTable
impl Send for HuffmanTable
impl Sync for HuffmanTable
impl Unpin for HuffmanTable
impl UnwindSafe for HuffmanTable
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