Skip to main content

LevelParams

Struct LevelParams 

Source
pub struct LevelParams {
    pub strategy: Strategy,
    pub window_log: u32,
    pub hash_log: u32,
    pub chain_log: u32,
    pub search_log: u32,
    pub min_match: u32,
    pub target_length: u32,
    pub search_strength: u32,
    pub force_raw_literals: bool,
}
Expand description

Compression parameters for a specific level.

Obtain via level_params or construct directly for custom tuning. Pass to compress_with_params.

Fields§

§strategy: Strategy

Match finder.

§window_log: u32

Log2 of the window size in bytes, WINDOW_LOG_MIN to WINDOW_LOG_MAX.

§hash_log: u32

Log2 of the entries of the Fast table, or of the DFast long table.

§chain_log: u32

DFast short table log. Same as hashLog for Fast strategy.

§search_log: u32

C zstd’s searchLog. The Fast and DFast finders ignore it.

§min_match: u32

Bytes the Fast table hashes, 4 to 8, or the DFast short table, 4 or 5. A Fast match needs 8 equal bytes at 8, else 4.

§target_length: u32

Fast only: the search step starts at target_length + 1 bytes, at least 2, as in C zstd. Above 1, with min_match 5 or more, it also keeps dense literals raw.

§search_strength: u32

The search step grows by one every 2^search_strength bytes without a match. C zstd has no such parameter.

§force_raw_literals: bool

Keep literals raw and use the predefined sequence tables. Blocks over 32 KiB that are almost all literals may still take Huffman literals.

Implementations§

Source§

impl LevelParams

Source

pub fn with_window_log(self, window_log: u32) -> Self

Sets the window to 2^window_log bytes. compress_with_params clamps it to WINDOW_LOG_MIN..=WINDOW_LOG_MAX and to the input.

Trait Implementations§

Source§

impl Clone for LevelParams

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

Source§

impl Debug for LevelParams

Source§

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

Formats the value using the given formatter. 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, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

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.