pub struct ZstdDictionary { /* private fields */ }Expand description
A Zstandard dictionary for compression/decompression
Implementations§
Source§impl ZstdDictionary
impl ZstdDictionary
Sourcepub fn from_content(content: Vec<u8>) -> Result<Self>
pub fn from_content(content: Vec<u8>) -> Result<Self>
Create a new dictionary from raw content
Sourcepub fn train(samples: &[&[u8]], dict_size: usize) -> Result<Self>
pub fn train(samples: &[&[u8]], dict_size: usize) -> Result<Self>
Train a dictionary from samples
Uses a simple but effective algorithm:
- Find common substrings across samples
- Score by frequency * length
- Select top patterns up to target size
Trait Implementations§
Source§impl Clone for ZstdDictionary
impl Clone for ZstdDictionary
Source§fn clone(&self) -> ZstdDictionary
fn clone(&self) -> ZstdDictionary
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 moreAuto Trait Implementations§
impl Freeze for ZstdDictionary
impl RefUnwindSafe for ZstdDictionary
impl Send for ZstdDictionary
impl Sync for ZstdDictionary
impl Unpin for ZstdDictionary
impl UnwindSafe for ZstdDictionary
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