pub struct EncoderOptions { /* private fields */ }Available on crate feature
std only.Expand description
Configuration for the bounded-memory streaming encoder.
Implementations§
Source§impl EncoderOptions
impl EncoderOptions
Sourcepub const fn new(level: CompressionLevel) -> Self
pub const fn new(level: CompressionLevel) -> Self
Creates options using the 96 MiB memory budget and 8 MiB frame chunks.
pub const fn level(&self) -> CompressionLevel
pub const fn memory_limit(&self) -> usize
pub const fn frame_chunk_size(&self) -> usize
pub fn dictionary(&self) -> Option<&EncoderDictionary>
pub const fn checksum(&self) -> bool
Sourcepub fn estimated_memory_usage(&self) -> usize
pub fn estimated_memory_usage(&self) -> usize
Returns the conservative memory estimate checked by Encoder::new.
Sourcepub const fn with_memory_limit(self, bytes: usize) -> Self
pub const fn with_memory_limit(self, bytes: usize) -> Self
Sets the maximum conservative working-memory estimate.
Sourcepub const fn with_frame_chunk_size(self, bytes: usize) -> Self
pub const fn with_frame_chunk_size(self, bytes: usize) -> Self
Sets the input bytes collected per independent Zstandard frame.
Smaller chunks reduce latency and memory use but can reduce compression ratio because matches do not cross frame boundaries.
Sourcepub fn with_dictionary(self, dictionary: EncoderDictionary) -> Self
pub fn with_dictionary(self, dictionary: EncoderDictionary) -> Self
Uses a prepared dictionary for every frame in the output archive.
Sourcepub const fn with_checksum(self, enabled: bool) -> Self
pub const fn with_checksum(self, enabled: bool) -> Self
Enables or disables the standard 32-bit frame content checksum.
Trait Implementations§
Source§impl Clone for EncoderOptions
impl Clone for EncoderOptions
Source§fn clone(&self) -> EncoderOptions
fn clone(&self) -> EncoderOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 EncoderOptions
impl Debug for EncoderOptions
Auto Trait Implementations§
impl !Send for EncoderOptions
impl !Sync for EncoderOptions
impl Freeze for EncoderOptions
impl RefUnwindSafe for EncoderOptions
impl Unpin for EncoderOptions
impl UnsafeUnpin for EncoderOptions
impl UnwindSafe for EncoderOptions
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