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.
pub fn huf_table(&self) -> Option<(&[HuffmanDecodeEntry], u8)>
pub fn of_table(&self) -> Option<(&[FseDecodeEntry], u8)>
pub fn ml_table(&self) -> Option<(&[FseDecodeEntry], u8)>
pub fn ll_table(&self) -> Option<(&[FseDecodeEntry], u8)>
Auto 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