pub struct CParameter(/* private fields */);
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
impl CParameter
Sourcepub fn window_log(value: u32) -> Self
pub fn window_log(value: u32) -> Self
Window size in bytes (as a power of two)
Sourcepub fn hash_log(value: u32) -> Self
pub fn hash_log(value: u32) -> Self
Size of the initial probe table in 4-byte entries (as a power of two)
Sourcepub fn chain_log(value: u32) -> Self
pub fn chain_log(value: u32) -> Self
Size of the multi-probe table in 4-byte entries (as a power of two)
Sourcepub fn search_log(value: u32) -> Self
pub fn search_log(value: u32) -> Self
Number of search attempts (as a power of two)
Sourcepub fn target_length(value: u32) -> Self
pub fn target_length(value: u32) -> Self
Strategy-dependent length modifier
Sourcepub fn enable_long_distance_matching(value: bool) -> Self
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.
Sourcepub fn ldm_hash_log(value: u32) -> Self
pub fn ldm_hash_log(value: u32) -> Self
Size of the long-distance matching table (as a power of two)
Sourcepub fn ldm_min_match(value: u32) -> Self
pub fn ldm_min_match(value: u32) -> Self
Minimum size of long-distance matches searched for
Sourcepub fn ldm_bucket_size_log(value: u32) -> Self
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)
Sourcepub fn ldm_hash_rate_log(value: u32) -> Self
pub fn ldm_hash_rate_log(value: u32) -> Self
Frequency of using the LDM hash table (as a power of two)
Sourcepub fn content_size_flag(value: bool) -> Self
pub fn content_size_flag(value: bool) -> Self
Emit the size of the content (default: true).
Sourcepub fn checksum_flag(value: bool) -> Self
pub fn checksum_flag(value: bool) -> Self
Emit a checksum (default: false).
Sourcepub fn dict_id_flag(value: bool) -> Self
pub fn dict_id_flag(value: bool) -> Self
Emit a dictionary ID when using a custom dictionary (default: true).
Sourcepub fn nb_workers(value: u32) -> Self
Available on crate feature zstdmt
only.
pub fn nb_workers(value: u32) -> Self
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.
Trait Implementations§
Source§impl Clone for CParameter
impl Clone for CParameter
Source§fn clone(&self) -> CParameter
fn clone(&self) -> CParameter
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more