pub struct Dictionary { /* private fields */ }Expand description
A parsed Zstandard dictionary, ready to seed decompression.
Build one with Dictionary::new (which auto-detects the formatted and
raw-content cases) or Dictionary::raw_content. Pass it to
DecodeOptions::dictionary.
Implementations§
Source§impl Dictionary
impl Dictionary
Sourcepub fn new(bytes: &[u8]) -> Result<Self, Error>
pub fn new(bytes: &[u8]) -> Result<Self, Error>
Parse a dictionary buffer.
A buffer that begins with the ZDICT magic number is parsed as a
formatted dictionary; anything else is treated as raw content, matching
the C library’s ZSTD_isFrameMagic/raw-content fallback. A buffer that
begins with the magic but is malformed yields Error::DictionaryCorrupted.
Sourcepub fn raw_content(content: &[u8]) -> Self
pub fn raw_content(content: &[u8]) -> Self
Treat content as a raw-content dictionary: window history with the
default repeat offsets and no precomputed entropy tables. The
dictionary ID is zero.
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