pub struct EncoderOptions { /* private fields */ }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
pub const fn tuning(&self) -> CompressionTuning
pub const fn pledged_source_size(&self) -> Option<u64>
pub const fn content_size_policy(&self) -> ContentSizePolicy
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.
Sourcepub const fn with_tuning(self, tuning: CompressionTuning) -> Self
pub const fn with_tuning(self, tuning: CompressionTuning) -> Self
Applies validated, typed overrides to the selected level preset.
Sourcepub const fn with_pledged_source_size(self, bytes: u64) -> Self
pub const fn with_pledged_source_size(self, bytes: u64) -> Self
Declares the exact number of input bytes the encoder must receive.
Sourcepub const fn with_content_size_policy(self, policy: ContentSizePolicy) -> Self
pub const fn with_content_size_policy(self, policy: ContentSizePolicy) -> Self
Includes or omits the decoded size in each emitted frame header.