Struct ruzstd::huff0::HuffmanTable
source · pub struct HuffmanTable {
pub max_num_bits: u8,
/* private fields */
}
Fields§
§max_num_bits: u8
The maximum size in bits a prefix code in the encoded data can be. This value is used so that the decoder knows how many bits to read from the bitstream before checking the table. This value must be 11 or lower.
Implementations§
source§impl HuffmanTable
impl HuffmanTable
sourcepub fn new() -> HuffmanTable
pub fn new() -> HuffmanTable
Create a new, empty table.
sourcepub fn reinit_from(&mut self, other: &Self)
pub fn reinit_from(&mut self, other: &Self)
Completely empty the table then repopulate as a replica
of other
.
sourcepub fn build_decoder(&mut self, source: &[u8]) -> Result<u32, HuffmanTableError>
pub fn build_decoder(&mut self, source: &[u8]) -> Result<u32, HuffmanTableError>
Read from source
and parse it into a huffman table.
Returns the number of bytes read.
Trait Implementations§
Auto 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