async_compression::zstd

Struct CParameter

Source
pub struct CParameter(/* private fields */);
Available on crate feature zstd only.
Expand description

A compression parameter for zstd. This is a stable wrapper around zstd’s own CParameter type, to abstract over different versions of the zstd library.

See the zstd documentation for more information on these parameters.

Implementations§

Source§

impl CParameter

Source

pub fn window_log(value: u32) -> Self

Window size in bytes (as a power of two)

Source

pub fn hash_log(value: u32) -> Self

Size of the initial probe table in 4-byte entries (as a power of two)

Source

pub fn chain_log(value: u32) -> Self

Size of the multi-probe table in 4-byte entries (as a power of two)

Source

pub fn search_log(value: u32) -> Self

Number of search attempts (as a power of two)

Source

pub fn min_match(value: u32) -> Self

Minimum size of matches searched for

Source

pub fn target_length(value: u32) -> Self

Strategy-dependent length modifier

Source

pub fn enable_long_distance_matching(value: bool) -> Self

Enable long-distance matching mode to look for and emit long-distance references.

This increases the default window size.

Source

pub fn ldm_hash_log(value: u32) -> Self

Size of the long-distance matching table (as a power of two)

Source

pub fn ldm_min_match(value: u32) -> Self

Minimum size of long-distance matches searched for

Source

pub fn ldm_bucket_size_log(value: u32) -> Self

Size of each bucket in the LDM hash table for collision resolution (as a power of two)

Source

pub fn ldm_hash_rate_log(value: u32) -> Self

Frequency of using the LDM hash table (as a power of two)

Source

pub fn content_size_flag(value: bool) -> Self

Emit the size of the content (default: true).

Source

pub fn checksum_flag(value: bool) -> Self

Emit a checksum (default: false).

Source

pub fn dict_id_flag(value: bool) -> Self

Emit a dictionary ID when using a custom dictionary (default: true).

Source

pub fn nb_workers(value: u32) -> Self

Available on crate feature zstdmt only.

Number of threads to spawn.

If set to 0, compression functions will block; if set to 1 or more, compression will run in background threads and flush pushes bytes through the compressor.

§Panics

This parameter requires feature zstdmt to be enabled, otherwise it will cause a panic when used in ZstdEncoder::with_quality_and_params() calls.

Source

pub fn job_size(value: u32) -> Self

Number of bytes given to each worker.

If set to 0, zstd selects a job size based on compression parameters.

Trait Implementations§

Source§

impl Clone for CParameter

Source§

fn clone(&self) -> CParameter

Returns a copy of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for CParameter

Source§

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

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

impl PartialEq for CParameter

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for CParameter

Source§

impl Eq for CParameter

Source§

impl StructuralPartialEq for CParameter

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, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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.