Struct deflate::CompressionOptions [] [src]

pub struct CompressionOptions {
    pub max_hash_checks: u16,
    pub lazy_if_less_than: u16,
    pub matching_type: MatchingType,
    pub special: SpecialOptions,
}

A struct describing the options for a compressor or compression function.

These values are not stable and still subject to change!

Fields

The maximum number of checks to make in the hash table for matches.

Higher numbers mean slower, but better compression. Very high (say >1024) values will impact compression speed a lot. Default value: 128

Only lazy match if we have a length less than this value.

Higher values degrade compression slightly, but improve compression speed.

  • 0: Never lazy match. (Same effect as setting MatchingType to greedy, but may be slower).
  • 1...257: Only check for a better match if the first match was shorter than this value.
  • 258: Always lazy match.

As the maximum length of a match is 258, values higher than this will have no further effect.

  • Default value: 32

Whether to use lazy or greedy matching.

Lazy matching will provide better compression, at the expense of compression speed.

See MatchingType

  • Default value: MatchingType::Lazy

Force fixed/stored blocks (Not implemented yet).

Methods

impl CompressionOptions
[src]

Returns compression settings rouhgly corresponding to the HIGH(9) setting in miniz.

Returns a fast set of compression settings

Ideally this should roughly correspond to the FAST(1) setting in miniz. However, that setting makes miniz use a somewhat different algorhithm, so currently hte fast level in this library is slower and better compressing than the corresponding level in miniz.

Trait Implementations

impl Copy for CompressionOptions
[src]

impl Clone for CompressionOptions
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for CompressionOptions
[src]

Formats the value using the given formatter.

impl Default for CompressionOptions
[src]

Returns the options describing the default compression level.

impl From<Compression> for CompressionOptions
[src]

Performs the conversion.