Skip to main content

ZSTD_dictAttachPref_e

Struct ZSTD_dictAttachPref_e 

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

Note: this enum and the behavior it controls are effectively internal implementation details of the compressor. They are expected to continue to evolve and should be considered only in the context of extremely advanced performance tuning.

Zstd currently supports the use of a ZSTD_CDict in three ways:

  • The contents of the CDict can be copied into the working context. This means that the compression can search both the dictionary and input while operating on a single set of internal tables. This makes the compression faster per byte of input. However, the initial copy of the CDict’s tables incurs a fixed cost at the beginning of the compression. For small compressions (< 8 KB), that copy can dominate the cost of the compression.

  • The CDict’s tables can be used in-place. In this model, compression is slower per input byte, because the compressor has to search two sets of tables. However, this model incurs no start-up cost (as long as the working context’s tables can be reused). For small inputs, this can be faster than copying the CDict’s tables.

  • The CDict’s tables are not used at all, and instead we use the working context alone to reload the dictionary and use params based on the source size. See ZSTD_compress_insertDictionary and ZSTD_compress_usingDict. This method is effective when the dictionary sizes are very small relative to the input size, and the input size is fairly large to begin with.

Zstd has a simple internal heuristic that selects which strategy to use at the beginning of a compression. However, if experimentation shows that Zstd is making poor choices, it is possible to override that choice with this enum.

Implementations§

Source§

impl ZSTD_dictAttachPref_e

Source

pub const ZSTD_dictDefaultAttach: Self

Use the default heuristic

Source

pub const ZSTD_dictForceAttach: Self

Never copy the dictionary

Source

pub const ZSTD_dictForceCopy: Self

Always copy the dictionary

Source

pub const ZSTD_dictForceLoad: Self

Always reload the dictionary

Trait Implementations§

Source§

impl Clone for ZSTD_dictAttachPref_e

Source§

fn clone(&self) -> ZSTD_dictAttachPref_e

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_dictAttachPref_e

Source§

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

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

impl PartialEq for ZSTD_dictAttachPref_e

Source§

fn eq(&self, other: &ZSTD_dictAttachPref_e) -> 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 TryFrom<i32> for ZSTD_dictAttachPref_e

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: i32) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl Copy for ZSTD_dictAttachPref_e

Source§

impl Eq for ZSTD_dictAttachPref_e

Source§

impl StructuralPartialEq for ZSTD_dictAttachPref_e

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.