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
Fastest
Provide the fastest compression possible.
Default
Use a reasonable default, which does not consume too much CPU/memory.
Best
Provide the best compression possible.
Numeric(u8)
Fine-grained controll over the compression for the xz
algorithm. Allowed values are 0-9
.
Trait Implementations
impl Clone for Compression
[src]
fn clone(&self) -> Compression
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
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]
fn eq(&self, __arg_0: &Compression) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Compression) -> bool
[src]
This method tests for !=
.
impl Ord for Compression
[src]
fn cmp(&self, __arg_0: &Compression) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
[src]
ord_max_min
)Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
[src]
ord_max_min
)Compares and returns the minimum of two values. Read more
impl PartialOrd for Compression
[src]
fn partial_cmp(&self, __arg_0: &Compression) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &Compression) -> bool
[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &Compression) -> bool
[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &Compression) -> bool
[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &Compression) -> bool
[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]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Debug for Compression
[src]
impl Default for Compression
[src]
impl Into<Compression> for Compression
[src]
fn into(self) -> Compression
[src]
Performs the conversion.
impl Into<Compression> for Compression
[src]
fn into(self) -> Compression
[src]
Performs the conversion.