pub enum Huffman {
Compressed {
frequencies: Vec<Frequency>,
compressed_data: CompressedData,
},
}Variants§
Implementations§
source§impl Huffman
impl Huffman
Enum responsible for the compression and decompression of our input.
sourcepub fn compress(data: &str) -> Result<Huffman, CompressionError>
pub fn compress(data: &str) -> Result<Huffman, CompressionError>
Compress takes as input the data as a string and returns the data compressed in bits.
sourcepub fn decompress(&self) -> String
pub fn decompress(&self) -> String
A compressed huffman data can be decompressed to find back the original text using this method.
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