Skip to main content

CoverOptions

Struct CoverOptions 

Source
pub struct CoverOptions {
    pub k: u32,
    pub d: u32,
    pub steps: u32,
    pub split_point: f64,
    pub shrink: Option<u32>,
}
Available on crate feature dict-builder only.
Expand description

Tuning for COVER training, the knobs of the reference’s ZDICT_cover_params_t.

The defaults are those zstd --train-cover starts from: d of 8, a search over k in four steps, every sample both building and scoring.

Fields§

§k: u32

Segment size in bytes. Zero searches 50..=2000 when optimizing.

§d: u32

Dmer size in bytes, at most k. Zero searches 6 and 8 when optimizing.

§steps: u32

How many values of k the search tries; zero is 40.

§split_point: f64

Share of the samples dictionaries are built from, in (0, 1]; the rest score them. At 1 every sample does both. Zero or below is the trainer’s default: 1 for COVER, 0.75 for FastCOVER.

§shrink: Option<u32>

Try the content’s last 256, 512, 1024, … bytes, each finalized into a dictionary of its own, and keep the first whose scoring samples compress to at most this many percent more than with the whole content (upstream zstd COVER_selectDict). A dictionary so found is its header plus that tail, so none is smaller than the header plus 256 bytes. A search cuts its winner down this way; the parameters it chooses are unchanged.

Trait Implementations§

Source§

impl Clone for CoverOptions

Source§

fn clone(&self) -> Self

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 Copy for CoverOptions

Source§

impl Debug for CoverOptions

Source§

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

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

impl Default for CoverOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for CoverOptions

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for CoverOptions

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.