pub struct ZstdEncoder { /* private fields */ }Expand description
Zstandard encoder.
Supports multiple compression levels (0-22) with LZ77 matching, Huffman literal encoding, and FSE sequence encoding.
Implementations§
Source§impl ZstdEncoder
impl ZstdEncoder
Sourcepub fn set_checksum(&mut self, include: bool) -> &mut Self
pub fn set_checksum(&mut self, include: bool) -> &mut Self
Set whether to include content checksum.
Sourcepub fn set_content_size(&mut self, include: bool) -> &mut Self
pub fn set_content_size(&mut self, include: bool) -> &mut Self
Set whether to include content size in header.
Sourcepub fn set_strategy(&mut self, strategy: CompressionStrategy) -> &mut Self
pub fn set_strategy(&mut self, strategy: CompressionStrategy) -> &mut Self
Set compression strategy (only effective when level == 0).
Sourcepub fn set_level(&mut self, level: i32) -> &mut Self
pub fn set_level(&mut self, level: i32) -> &mut Self
Set compression level (0-22).
- Level 0: Raw/RLE blocks (fastest, no compression)
- Levels 1-3: Fast compression (greedy matching)
- Levels 4-9: Balanced compression (lazy matching)
- Levels 10-22: High compression (deep search)
Sourcepub fn set_dictionary(&mut self, dict: &[u8]) -> &mut Self
pub fn set_dictionary(&mut self, dict: &[u8]) -> &mut Self
Set a pre-trained dictionary for improved compression of small data.
Trait Implementations§
Source§impl Clone for ZstdEncoder
impl Clone for ZstdEncoder
Source§fn clone(&self) -> ZstdEncoder
fn clone(&self) -> ZstdEncoder
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 moreSource§impl Debug for ZstdEncoder
impl Debug for ZstdEncoder
Auto Trait Implementations§
impl Freeze for ZstdEncoder
impl RefUnwindSafe for ZstdEncoder
impl Send for ZstdEncoder
impl Sync for ZstdEncoder
impl Unpin for ZstdEncoder
impl UnsafeUnpin for ZstdEncoder
impl UnwindSafe for ZstdEncoder
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