pub enum CompressTable {
Small(HashTable4KU16),
Large(HashTable4K),
}Expand description
A reusable compression table that avoids re-allocating the internal hash table on every call.
This is useful when compressing many small inputs in a loop. Create one table and pass it
to compress_into_with_table repeatedly.
§Example
use lz4_flex::block::{compress_into_with_table, get_maximum_output_size, CompressTable};
let mut table = CompressTable::default();
let input = b"hello world, hello world, hello!";
let mut output = vec![0u8; get_maximum_output_size(input.len())];
let compressed_len = compress_into_with_table(input, &mut output, &mut table).unwrap();Variants§
Small(HashTable4KU16)
Table using 16-bit entries, suitable for inputs where input.len() < u16::MAX.
Large(HashTable4K)
Table using 32-bit entries, suitable for any input size.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CompressTable
impl RefUnwindSafe for CompressTable
impl Send for CompressTable
impl Sync for CompressTable
impl Unpin for CompressTable
impl UnsafeUnpin for CompressTable
impl UnwindSafe for CompressTable
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