Skip to main content

ZSTD_dParameter

Struct ZSTD_dParameter 

Source
pub struct ZSTD_dParameter(/* private fields */);
Expand description

The advanced API pushes parameters one by one into an existing ZSTD_DCtx decompression context. Parameters are sticky, and remain valid for all following frames using the same context.

It’s possible to reset parameters to default values using ZSTD_DCtx_reset.

Implementations§

Source§

impl ZSTD_dParameter

Source

pub const ZSTD_d_experimentalParam1: Self

Source

pub const ZSTD_d_experimentalParam2: Self

Source

pub const ZSTD_d_experimentalParam3: Self

Source

pub const ZSTD_d_experimentalParam4: Self

Source

pub const ZSTD_d_experimentalParam5: Self

Source

pub const ZSTD_d_experimentalParam6: Self

Source

pub const ZSTD_d_format: Self = Self::ZSTD_d_experimentalParam1

Experimental parameter: allowing selection between ZSTD_format_e input compression formats

Source

pub const ZSTD_d_stableOutBuffer: Self = Self::ZSTD_d_experimentalParam2

Experimental parameter: tells the decompressor that the ZSTD_outBuffer will ALWAYS be the same between calls, except for the modifications that zstd makes to pos (the caller must not modify pos). This is checked by the decompressor, and decompression will fail if it ever changes. Therefore the ZSTD_outBuffer MUST be large enough to fit the entire decompressed frame. This will be checked when the frame content size is known. The data in the ZSTD_outBuffer in the range dst..(dst + pos) MUST not be modified during decompression or you will get data corruption.

When this flag is enabled zstd won’t allocate an output buffer, because it can write directly to the ZSTD_outBuffer, but it will still allocate an input buffer large enough to fit any compressed block. This will also avoid the memcpy() from the internal output buffer to the ZSTD_outBuffer. If you need to avoid the input buffer allocation use the buffer-less streaming API.

Note: So long as the ZSTD_outBuffer always points to valid memory, using this flag is ALWAYS memory safe, and will never access out-of-bounds memory. However, decompression WILL fail if you violate the preconditions.

Warning: The data in the ZSTD_outBuffer in the range dst..(dst + pos) MUST not be modified during decompression or you will get data corruption. This is because zstd needs to reference data in the ZSTD_outBuffer to regenerate matches. Normally zstd maintains its own buffer for this purpose, but passing this flag tells zstd to use the user provided buffer.

Default is 0 == disabled. Set to 1 to enable.

Source

pub const ZSTD_d_forceIgnoreChecksum: Self = Self::ZSTD_d_experimentalParam3

Experimental parameter: tells the decompressor to skip checksum validation during decompression, regardless of whether checksumming was specified during compression. This offers some slight performance benefits, and may be useful for debugging.

Default is 0 == disabled. Set to 1 to enable.

Source

pub const ZSTD_d_refMultipleDDicts: Self = Self::ZSTD_d_experimentalParam4

Experimental parameter: if enabled and ZSTD_DCtx is allocated on the heap, then additional memory will be allocated to store references to multiple ZSTD_DDict. That is, multiple calls of ZSTD_DCtx_refDDict using a given ZSTD_DCtx, rather than overwriting the previous DDict reference, will instead store all references. At decompression time, the appropriate dictID is selected from the set of DDicts based on the dictID in the frame.

Warning: Enabling this parameter and calling ZSTD_DCtx_refDDict will trigger memory allocation for the hash table. ZSTD_freeDCtx also frees this memory. Memory is allocated as per ZSTD_DCtx::customMem.

Although this function allocates memory for the table, the user is still responsible for memory management of the underlying ZSTD_DDict themselves.

Default is 0 == disabled. Set to 1 to enable.

Source

pub const ZSTD_d_disableHuffmanAssembly: Self = Self::ZSTD_d_experimentalParam5

This parameter can be used to disable Huffman assembly at runtime.

Set to 1 to disable the Huffman assembly implementation. The default value is 0, which allows zstd to use the Huffman assembly implementation if available.

Source

pub const ZSTD_d_maxBlockSize: Self = Self::ZSTD_d_experimentalParam6

Forces the decompressor to reject blocks whose content size is larger than the configured maxBlockSize. When maxBlockSize is larger than the windowSize, the windowSize is used instead. This saves memory on the decoder when you know all blocks are small.

Allowed values are between 1KB and ZSTD_BLOCKSIZE_MAX (128KB). The default is ZSTD_BLOCKSIZE_MAX, and setting to 0 will set to the default.

This option is typically used in conjunction with ZSTD_c_maxBlockSize.

Warning: This causes the decoder to reject otherwise valid frames that have block sizes larger than the configured maxBlockSize.

Source

pub const ZSTD_d_windowLogMax: Self

Select a size limit (in power of 2) beyond which the streaming API will refuse to allocate memory buffer in order to protect the host from unreasonable memory requirements.

This parameter is only useful in streaming mode, since no internal buffer is allocated in single-pass mode. By default, a decompression context accepts window sizes less than or equal to (1 << ZSTD_WINDOWLOG_LIMIT_DEFAULT).

A value of 0 means “use default maximum windowLog”.

Trait Implementations§

Source§

impl Clone for ZSTD_dParameter

Source§

fn clone(&self) -> ZSTD_dParameter

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 Debug for ZSTD_dParameter

Source§

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

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

impl PartialEq for ZSTD_dParameter

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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 ZSTD_dParameter

Source§

impl Eq for ZSTD_dParameter

Source§

impl StructuralPartialEq for ZSTD_dParameter

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.