Skip to main content

CompressionParameters

Struct CompressionParameters 

Source
pub struct CompressionParameters {
Show 14 fields pub window_log: u32, pub chain_log: u32, pub hash_log: u32, pub search_log: u32, pub min_match: u32, pub target_length: u32, pub strategy: Strategy, pub enable_ldm: bool, pub ldm_hash_log: u32, pub ldm_min_match: u32, pub ldm_hash_rate_log: u32, pub nb_workers: u32, pub job_size: u32, pub overlap_log: u32,
}
Expand description

libzstd ZSTD_compressionParameters for a level and size hint.

Fields§

§window_log: u32

windowLog (power of two window).

§chain_log: u32

chainLog.

§hash_log: u32

hashLog.

§search_log: u32

searchLog (chain attempts = 2^searchLog).

§min_match: u32

minMatch (3..=7).

§target_length: u32

targetLength (fast skip / parser target).

§strategy: Strategy

Strategy C would pick.

§enable_ldm: bool

--zstd=enableLdm (also set by CLI --long / --rsyncable).

§ldm_hash_log: u32

--zstd=ldmHashLog. 0 = default from windowLog.

§ldm_min_match: u32

--zstd=ldmMinMatch. 0 = 64.

§ldm_hash_rate_log: u32

--zstd=ldmHashRateLog. 0 = default from windowLog.

§nb_workers: u32

--zstd=nbWorkers. 0 = leave unset (CLI -T / --single-thread win).

§job_size: u32

--zstd=jobSize. 0 = default.

§overlap_log: u32

--zstd=overlapLog. 0 = default by strategy.

Implementations§

Source§

impl CompressionParameters

Source

pub fn to_zstd_option_string(self) -> String

facebook/zstd --show-default-cparams / --zstd= line (no prefix).

Source

pub fn apply_zstd_option_string(&mut self, spec: &str) -> Result<(), Error>

Apply a comma-separated --zstd=key=value,... spec (prefix optional).

Source

pub fn ldm_params(self) -> LdmParams

LDM knobs parsed from --zstd= (CLI --long may still force enable).

Source

pub fn apply_zstd_kv(&mut self, key: &str, value: i32) -> Result<(), Error>

Apply one --zstd=key=value assignment. Unknown keys are errors.

Trait Implementations§

Source§

impl Clone for CompressionParameters

Source§

fn clone(&self) -> CompressionParameters

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 Copy for CompressionParameters

Source§

impl Debug for CompressionParameters

Source§

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

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

impl Eq for CompressionParameters

Source§

impl PartialEq for CompressionParameters

Source§

fn eq(&self, other: &CompressionParameters) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for CompressionParameters

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.