pub struct Huffman { /* private fields */ }Expand description
Holds the data needed to (de)compress.
- Compress with Self::compress
- Decompress with Self::decompress
Implementations§
Source§impl Huffman
impl Huffman
Sourcepub fn new(frequency_table: &[usize; 256]) -> Self
pub fn new(frequency_table: &[usize; 256]) -> Self
Initializes the huffman interface using the provided frequency table.
Sourcepub fn new_from_data(data: &[u8]) -> Self
pub fn new_from_data(data: &[u8]) -> Self
Creates the Huffman frequency table from the provided data and initializes from it.
Sourcepub fn calculate_freq_table(table: &mut [usize; 256], data: &[u8])
pub fn calculate_freq_table(table: &mut [usize; 256], data: &[u8])
Calculates the frequency table from the provided data.
Trait Implementations§
impl Eq for Huffman
impl StructuralPartialEq for Huffman
Auto Trait Implementations§
impl Freeze for Huffman
impl RefUnwindSafe for Huffman
impl Send for Huffman
impl Sync for Huffman
impl Unpin for Huffman
impl UnwindSafe for Huffman
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