Skip to main content

Compression

Enum Compression 

Source
#[non_exhaustive]
#[repr(u16)]
pub enum Compression {
Show 29 variants Stored = 0, Shrink = 1, ReduceFactor1 = 2, ReduceFactor2 = 3, ReduceFactor3 = 4, ReduceFactor4 = 5, Implode = 6, TokenizingCompression = 7, Deflated = 8, Deflate64 = 9, PkwareDataCompressionImploding = 10, Reserved11 = 11, Bzip2 = 12, Reserved13 = 13, Lzma = 14, Reserved15 = 15, CmpscCompression = 16, Reserved17 = 17, IbmTerseNew = 18, IbmLz77 = 19, DeprecatedZstd = 20, Zstd = 93, Mp3 = 94, Xz = 95, Jpeg = 96, WavPack = 97, Ppmd = 98, Aes = 99, Unknown(u16),
}
Expand description

Compression

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Stored = 0

Store the file as is

§

Shrink = 1

Method 1 Shrink

§

ReduceFactor1 = 2

Reduce with compression factor 1

§

ReduceFactor2 = 3

Reduce with compression factor 2

§

ReduceFactor3 = 4

Reduce with compression factor 3

§

ReduceFactor4 = 5

Reduce with compression factor 4

§

Implode = 6

Implode/explode

§

TokenizingCompression = 7

Reserved for Tokenizing compression algorithm

§

Deflated = 8

Compress the file using Deflate

§

Deflate64 = 9

Compress the file using Deflate64.

§

PkwareDataCompressionImploding = 10

PKWARE Data Compression Library Imploding (old IBM TERSE)

§

Reserved11 = 11

Reserved by PKWARE

§

Bzip2 = 12

Compress the file using BZIP2

§

Reserved13 = 13

Reserved by PKWARE

§

Lzma = 14

Compress the file using LZMA

§

Reserved15 = 15

Reserved by PKWARE

§

CmpscCompression = 16

IBM z/OS CMPSC Compression

§

Reserved17 = 17

Reserved by PKWARE

§

IbmTerseNew = 18

File is compressed using IBM TERSE (new)

§

IbmLz77 = 19

IBM LZ77 z Architecture

§

DeprecatedZstd = 20

deprecated ZSTD

§

Zstd = 93

Compress the file using ZStandard

§

Mp3 = 94

MP3 Compression

§

Xz = 95

Compress the file using XZ

§

Jpeg = 96

JPEG variant

§

WavPack = 97

WavPack compressed data

§

Ppmd = 98

Compress the file using PPMd

§

Aes = 99

Encrypted using AES.

The actual compression method has to be taken from the AES extra data field or from ZipFileData.

§

Unknown(u16)

Unsupported compression method

Implementations§

Source§

impl Compression

Source

pub fn as_u16(self) -> u16

as u16

Trait Implementations§

Source§

impl Clone for Compression

Source§

fn clone(&self) -> Compression

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 Compression

Source§

impl Debug for Compression

Source§

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

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

impl Default for Compression

Source§

fn default() -> Compression

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

impl Eq for Compression

Source§

impl From<Compression> for u16

Source§

fn from(value: Compression) -> Self

Converts to this type from the input type.
Source§

impl From<CompressionMethod> for Compression

Source§

fn from(value: CompressionMethod) -> Self

Converts to this type from the input type.
Source§

impl From<u16> for Compression

Source§

fn from(value: u16) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Compression

Source§

fn eq(&self, other: &Compression) -> 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 Compression

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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.