Struct EncoderConfig

Source
pub struct EncoderConfig {
    pub match_src: Option<SrcMatcherConfig>,
    pub match_trgt: Option<TrgtMatcherConfig>,
    pub sec_comp: Option<SecondaryCompression>,
    pub format: Format,
    pub output_segment_size: usize,
    pub naive_tests: Option<LargerTrgtNaiveTests>,
    pub lazy_escape_len: Option<usize>,
}
Expand description

Configuration for the encoder.

Default values are:

  • match_src: Some(SrcMatcherConfig::new_from_compression_level(3))
  • match_target: None
  • sec_comp: None
  • format: Interleaved
  • output_segment_size: MAX_WIN_SIZE
  • naive_tests: None
  • lazy_escape_len: Some(45)

Fields§

§match_src: Option<SrcMatcherConfig>

Do we consider the src file as a dictionary to find matches? If so (Some(_)), any preferences set in the MatcherConfig will be used. Default Value: Some(SrcMatcherConfig::new_from_compression_level(3))

§match_trgt: Option<TrgtMatcherConfig>

Whether to use the output file in an attempt to compress itself. If so (Some(_)), any preferences set in the MatcherConfig will be used. Default Value: None

§sec_comp: Option<SecondaryCompression>

None for no secondary compression. Default Value: None

§format: Format

Whether to interleave or segregate the Add bytes. Default Value: Interleaved

§output_segment_size: usize

The size of the output window. Default Value: MAX_WIN_SIZE The minimum value is MAX_INST_SIZE.

§naive_tests: Option<LargerTrgtNaiveTests>

The types of naive tests to run. Default Value: None

§lazy_escape_len: Option<usize>

The length of a match that will end the lazy matching sequence. Default Value: Some(45)

Implementations§

Source§

impl EncoderConfig

Source

pub fn new() -> Self

Source

pub fn no_match_src(self) -> Self

Source

pub fn no_match_target(self) -> Self

Source

pub fn no_sec_comp(self) -> Self

Source

pub fn set_match_src(self, config: SrcMatcherConfig) -> Self

Source

pub fn set_sec_comp(self, sec_comp: SecondaryCompression) -> Self

Source

pub fn format_interleaved(self) -> Self

Source

pub fn format_segregated(self) -> Self

Source

pub fn set_match_target(self, config: TrgtMatcherConfig) -> Self

Source

pub fn set_output_segment_size(self, size: usize) -> Self

Source

pub fn set_naive_tests(self, tests: LargerTrgtNaiveTests) -> Self

Source

pub fn set_lazy_escape_len(self, len: usize) -> Self

Source

pub fn comp_level( level: usize, match_trgt: bool, sec_comp: Option<SecondaryCompression>, ) -> Self

Use the short hand compression level. If match_trgt is true, the same compression level will be used to set the TrgtMatcherConfig. If secondary compression is Some(_), the format will be Segregated, else Interleaved.

Trait Implementations§

Source§

impl Clone for EncoderConfig

Source§

fn clone(&self) -> EncoderConfig

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 EncoderConfig

Source§

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

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

impl Default for EncoderConfig

Source§

fn default() -> Self

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

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.