Struct async_compression::zstd::CParameter

source ·
pub struct CParameter(/* private fields */);
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

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

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

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

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

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

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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,

§

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>,

§

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>,

§

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.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more