Skip to main content

CompressionMethod

Struct CompressionMethod 

Source
pub struct CompressionMethod(/* private fields */);
Expand description

The compression method used on an individual Zip archive entry.

Contains associated consts for compression methods mentioned in the spec (§ 4.4.5).

Implementations§

Source§

impl CompressionMethod

Source

pub const STORE: Self

No compression.

Source

pub const SHRUNK: Self

Source

pub const REDUCE1: Self

Source

pub const REDUCE2: Self

Source

pub const REDUCE3: Self

Source

pub const REDUCE4: Self

Source

pub const IMPLODED: Self

Source

pub const TOKENIZING: Self

Source

pub const DEFLATE: Self

Deflate.

Source

pub const DEFLATE64: Self

Source

pub const DCL_IMPLODE: Self

PKWARE DCL Imploding. Historically also labeled “old IBM TERSE” in some APPNOTE revisions; method 18 (CompressionMethod::TERSE) is the current (“new”) IBM TERSE.

Source

pub const BZIP2: Self

Source

pub const LZMA: Self

Source

pub const CMPSC: Self

IBM CMPSC compression.

Source

pub const TERSE: Self

IBM TERSE (new).

Source

pub const LZ77: Self

IBM LZ77 z Architecture (PFS).

Source

pub const ZSTD_DEPRECATED: Self

Deprecated zstd id; use CompressionMethod::ZSTD (93) for zstd.

Source

pub const ZSTD: Self

Zstandard.

Source

pub const MP3: Self

Source

pub const XZ: Self

Source

pub const JPEG: Self

Source

pub const WAVPACK: Self

Source

pub const PPMD: Self

Source

pub const AES: Self

AES encryption.

Source

pub const fn new(id: u16) -> Self

Wrap a raw compression-method id.

Source

pub const fn as_u16(self) -> u16

Returns the raw value of the compression method.

Source

pub const fn name(self) -> Option<&'static str>

Returns the method name (eg“ "DEFLATE") when known

Source§

impl CompressionMethod

Source

pub const Store: Self = Self::STORE

👎Deprecated:

use CompressionMethod::STORE

Source

pub const Shrunk: Self = Self::SHRUNK

👎Deprecated:

use CompressionMethod::SHRUNK

Source

pub const Reduce1: Self = Self::REDUCE1

👎Deprecated:

use CompressionMethod::REDUCE1

Source

pub const Reduce2: Self = Self::REDUCE2

👎Deprecated:

use CompressionMethod::REDUCE2

Source

pub const Reduce3: Self = Self::REDUCE3

👎Deprecated:

use CompressionMethod::REDUCE3

Source

pub const Reduce4: Self = Self::REDUCE4

👎Deprecated:

use CompressionMethod::REDUCE4

Source

pub const Imploded: Self = Self::IMPLODED

👎Deprecated:

use CompressionMethod::IMPLODED

Source

pub const Tokenizing: Self = Self::TOKENIZING

👎Deprecated:

use CompressionMethod::TOKENIZING

Source

pub const Deflate: Self = Self::DEFLATE

👎Deprecated:

use CompressionMethod::DEFLATE

Source

pub const Deflate64: Self = Self::DEFLATE64

👎Deprecated:

use CompressionMethod::DEFLATE64

Source

pub const DclImplode: Self = Self::DCL_IMPLODE

👎Deprecated:

use CompressionMethod::DCL_IMPLODE

Source

pub const Bzip2: Self = Self::BZIP2

👎Deprecated:

use CompressionMethod::BZIP2

Source

pub const Lzma: Self = Self::LZMA

👎Deprecated:

use CompressionMethod::LZMA

Source

pub const Cmpsc: Self = Self::CMPSC

👎Deprecated:

use CompressionMethod::CMPSC

Source

pub const Terse: Self = Self::TERSE

👎Deprecated:

use CompressionMethod::TERSE

Source

pub const Lz77: Self = Self::LZ77

👎Deprecated:

use CompressionMethod::LZ77

Source

pub const ZstdDeprecated: Self = Self::ZSTD_DEPRECATED

👎Deprecated:

use CompressionMethod::ZSTD_DEPRECATED

Source

pub const Zstd: Self = Self::ZSTD

👎Deprecated:

use CompressionMethod::ZSTD

Source

pub const Mp3: Self = Self::MP3

👎Deprecated:

use CompressionMethod::MP3

Source

pub const Xz: Self = Self::XZ

👎Deprecated:

use CompressionMethod::XZ

Source

pub const Jpeg: Self = Self::JPEG

👎Deprecated:

use CompressionMethod::JPEG

Source

pub const WavPack: Self = Self::WAVPACK

👎Deprecated:

use CompressionMethod::WAVPACK

Source

pub const Ppmd: Self = Self::PPMD

👎Deprecated:

use CompressionMethod::PPMD

Source

pub const Aes: Self = Self::AES

👎Deprecated:

use CompressionMethod::AES

Trait Implementations§

Source§

impl Clone for CompressionMethod

Source§

fn clone(&self) -> Self

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 CompressionMethod

Source§

impl Debug for CompressionMethod

Source§

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

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

impl Display for CompressionMethod

Source§

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

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

impl Eq for CompressionMethod

Source§

impl From<u16> for CompressionMethod

Source§

fn from(id: u16) -> Self

Converts to this type from the input type.
Source§

impl Hash for CompressionMethod

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for CompressionMethod

Source§

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

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.