pub struct Dictionary { /* private fields */ }Expand description
A pre-trained zstd dictionary for improved compression of small data.
Load from raw bytes with Dictionary::from_bytes, or train with
[train_dict_fastcover] (requires dict_builder feature).
Implementations§
Source§impl Dictionary
impl Dictionary
Sourcepub fn from_bytes(data: &[u8]) -> Result<Self, DecompressError>
pub fn from_bytes(data: &[u8]) -> Result<Self, DecompressError>
Parses a dictionary from its raw byte representation.
Sourcepub fn content(&self) -> &[u8] ⓘ
pub fn content(&self) -> &[u8] ⓘ
Returns the raw content segment used as match-finding history prefix.
Sourcepub fn rep_offsets(&self) -> &[u32; 3]
pub fn rep_offsets(&self) -> &[u32; 3]
Returns the three initial repeat offsets stored in the dictionary.
Sourcepub fn huf_table(&self) -> Option<(&[HuffmanDecodeEntry], u8)>
pub fn huf_table(&self) -> Option<(&[HuffmanDecodeEntry], u8)>
Returns the Huffman decode table and its log2 size, if present.
Sourcepub fn of_table(&self) -> Option<(&[FseDecodeEntry], u8)>
pub fn of_table(&self) -> Option<(&[FseDecodeEntry], u8)>
Returns the offset-code FSE decode table and accuracy log, if present.
Sourcepub fn ml_table(&self) -> Option<(&[FseDecodeEntry], u8)>
pub fn ml_table(&self) -> Option<(&[FseDecodeEntry], u8)>
Returns the match-length FSE decode table and accuracy log, if present.
Sourcepub fn ll_table(&self) -> Option<(&[FseDecodeEntry], u8)>
pub fn ll_table(&self) -> Option<(&[FseDecodeEntry], u8)>
Returns the literal-length FSE decode table and accuracy log, if present.
Trait Implementations§
Source§impl Clone for Dictionary
impl Clone for Dictionary
Source§fn clone(&self) -> Dictionary
fn clone(&self) -> Dictionary
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for Dictionary
impl RefUnwindSafe for Dictionary
impl Send for Dictionary
impl Sync for Dictionary
impl Unpin for Dictionary
impl UnsafeUnpin for Dictionary
impl UnwindSafe for Dictionary
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