Skip to main content

EncoderOptions

Struct EncoderOptions 

Source
pub struct EncoderOptions { /* private fields */ }
Available on crate feature std only.
Expand description

Configuration for the bounded-memory streaming encoder.

Implementations§

Source§

impl EncoderOptions

Source

pub const fn new(level: CompressionLevel) -> Self

Creates options using the 96 MiB memory budget and 8 MiB frame chunks.

Source

pub const fn level(&self) -> CompressionLevel

Source

pub const fn memory_limit(&self) -> usize

Source

pub const fn frame_chunk_size(&self) -> usize

Source

pub fn dictionary(&self) -> Option<&EncoderDictionary>

Source

pub const fn checksum(&self) -> bool

Source

pub const fn tuning(&self) -> CompressionTuning

Source

pub const fn pledged_source_size(&self) -> Option<u64>

Source

pub const fn content_size_policy(&self) -> ContentSizePolicy

Source

pub fn estimated_memory_usage(&self) -> usize

Returns the conservative memory estimate checked by Encoder::new.

Source

pub const fn with_memory_limit(self, bytes: usize) -> Self

Sets the maximum conservative working-memory estimate.

Source

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.

Source

pub fn with_dictionary(self, dictionary: EncoderDictionary) -> Self

Uses a prepared dictionary for every frame in the output archive.

Source

pub const fn with_checksum(self, enabled: bool) -> Self

Enables or disables the standard 32-bit frame content checksum.

Source

pub const fn with_tuning(self, tuning: CompressionTuning) -> Self

Applies validated, typed overrides to the selected level preset.

Source

pub const fn with_pledged_source_size(self, bytes: u64) -> Self

Declares the exact number of input bytes the encoder must receive.

Source

pub const fn with_content_size_policy(self, policy: ContentSizePolicy) -> Self

Includes or omits the decoded size in each emitted frame header.

Trait Implementations§

Source§

impl Clone for EncoderOptions

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EncoderOptions

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for EncoderOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.