pub struct CustomFseTables {
pub ll_table: Option<Arc<FseTable>>,
pub of_table: Option<Arc<FseTable>>,
pub ml_table: Option<Arc<FseTable>>,
}Expand description
Custom FSE tables for sequence encoding.
Allows overriding the predefined FSE tables used for literal lengths (LL), offsets (OF), and match lengths (ML) in Zstd sequence encoding.
When a custom table is None, the predefined table is used instead.
§Example
use haagenti_zstd::{CustomFseTables, ZstdCompressor};
use haagenti_zstd::fse::FseTable;
// Build custom tables from normalized symbol distributions
let ll_dist = vec![4i16, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4]; // 16 symbols, sum=64
let ll_table = FseTable::from_predefined(&ll_dist, 6).unwrap();
let custom_tables = CustomFseTables::new()
.with_ll_table(ll_table);
let compressor = ZstdCompressor::with_custom_tables(custom_tables);Fields§
§ll_table: Option<Arc<FseTable>>Custom literal length FSE table.
of_table: Option<Arc<FseTable>>Custom offset FSE table.
ml_table: Option<Arc<FseTable>>Custom match length FSE table.
Implementations§
Source§impl CustomFseTables
impl CustomFseTables
Sourcepub fn with_ll_table(self, table: FseTable) -> Self
pub fn with_ll_table(self, table: FseTable) -> Self
Set custom literal length table.
Sourcepub fn with_of_table(self, table: FseTable) -> Self
pub fn with_of_table(self, table: FseTable) -> Self
Set custom offset table.
Sourcepub fn with_ml_table(self, table: FseTable) -> Self
pub fn with_ml_table(self, table: FseTable) -> Self
Set custom match length table.
Sourcepub fn has_custom_tables(&self) -> bool
pub fn has_custom_tables(&self) -> bool
Check if any custom tables are set.
Trait Implementations§
Source§impl Clone for CustomFseTables
impl Clone for CustomFseTables
Source§fn clone(&self) -> CustomFseTables
fn clone(&self) -> CustomFseTables
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 moreSource§impl Debug for CustomFseTables
impl Debug for CustomFseTables
Source§impl Default for CustomFseTables
impl Default for CustomFseTables
Source§fn default() -> CustomFseTables
fn default() -> CustomFseTables
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CustomFseTables
impl RefUnwindSafe for CustomFseTables
impl Send for CustomFseTables
impl Sync for CustomFseTables
impl Unpin for CustomFseTables
impl UnwindSafe for CustomFseTables
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