Enum misc_utils::fs::Compression [] [src]

pub enum Compression {
    Fastest,
    Default,
    Best,
    Numeric(u8),
}

Specify the compression level used.

There are three presets provided, Fastest, Default, and Best. They correspond to the settings in bzip2, gzip, and xz. Default corresponds to the value 6.

For bzip2 and gzip the Numeric values are mapped as follows:

Numeric bzip2 gzip
0 <No compression> Fastest
1 Fastest Fastest
2 Fastest Fastest
3 Fastest Fastest
4 Default Default
5 Default Default
6 Default Default
7 Best Best
8 Best Best
9 Best Best
other values Best Best

For xz Numeric values in the range 0-9 (inclusive) are valid. The named variants are mapped to 0 for Fastest, 6 for Default, and 9 for Best.

Be aware that the result in compression ratio and time/memory consumption is highly dependent on the chosen filetype.

Variants

Provide the fastest compression possible.

Use a reasonable default, which does not consume too much CPU/memory.

Provide the best compression possible.

Fine-grained controll over the compression for the xz algorithm. Allowed values are 0-9.

Trait Implementations

impl Clone for Compression
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Copy for Compression
[src]

impl Eq for Compression
[src]

impl PartialEq for Compression
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl Ord for Compression
[src]

[src]

This method returns an Ordering between self and other. Read more

[src]

🔬 This is a nightly-only experimental API. (ord_max_min)

Compares and returns the maximum of two values. Read more

[src]

🔬 This is a nightly-only experimental API. (ord_max_min)

Compares and returns the minimum of two values. Read more

impl PartialOrd for Compression
[src]

[src]

This method returns an ordering between self and other values if one exists. Read more

[src]

This method tests less than (for self and other) and is used by the < operator. Read more

[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Hash for Compression
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Debug for Compression
[src]

[src]

Formats the value using the given formatter.

impl Default for Compression
[src]

[src]

Returns the Default variant.

impl Into<Compression> for Compression
[src]

[src]

Performs the conversion.

impl Into<Compression> for Compression
[src]

[src]

Performs the conversion.

impl Into<XzCompression> for Compression
[src]

[src]

Performs the conversion.