pub struct Dictionary { /* private fields */ }Expand description
A decompression dictionary, parsed once and reused for many frames
(libzstd’s ZSTD_DDict).
Cloning is cheap: clones share the parsed content and tables (like
ZSTD_DCtx_refDDict), and a decompressor uses the tables in place
rather than copying them for each frame.
Implementations§
Source§impl Dictionary
impl Dictionary
Sourcepub fn new(data: &[u8]) -> Result<Dictionary, Error>
pub fn new(data: &[u8]) -> Result<Dictionary, Error>
Parses a dictionary like libzstd’s ZSTD_dct_auto: data that starts
with the dictionary magic number is a zstd dictionary (ID, entropy
tables, repeat offsets, content); anything else is raw content.
§Errors
Error::InvalidDictionary if a zstd-format dictionary is corrupt.
Sourcepub fn raw(data: &[u8]) -> Dictionary
pub fn raw(data: &[u8]) -> Dictionary
A raw content dictionary (ID 0): data is only history for matches.
Trait Implementations§
Source§impl Clone for Dictionary
impl Clone for Dictionary
Auto Trait Implementations§
impl Forget for Dictionary
impl Freeze for Dictionary
impl Move 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 Dictionarywhere
Arc<Inner>: UnwindSafe,
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