Enum CompressionMethod

#[non_exhaustive]
pub enum CompressionMethod

Identifies the storage format used to compress a file within a ZIP archive.

Each file's compression method is stored alongside it, allowing the contents to be read without context.

When creating ZIP files, you may choose the method to use with crate::write::FileOptions::compression_method

Variants

Stored

Store the file as is

Deflated

Compress the file using Deflate

Deflate64

Compress the file using Deflate64. Decoding deflate64 is supported but encoding deflate64 is not supported.

Bzip2

Compress the file using BZIP2

Aes

Encrypted using AES.

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

Zstd

Compress the file using ZStandard

Lzma

Compress the file using LZMA

Xz

Compress the file using XZ

Ppmd

Compress the file using PPMd

Unsupported(u16)

Unsupported compression method

Implementations

impl CompressionMethod

const STORE: Self = CompressionMethod::Stored;
const SHRINK: Self = _;

Legacy compression method (enable feature legacy-zip to get support)

const REDUCE_1: Self = _;

Legacy compression method (enable feature legacy-zip to get support)

const REDUCE_2: Self = _;

Legacy compression method (enable feature legacy-zip to get support)

const REDUCE_3: Self = _;

Legacy compression method (enable feature legacy-zip to get support)

const REDUCE_4: Self = _;

Legacy compression method (enable feature legacy-zip to get support)

const IMPLODE: Self = _;

Legacy compression method (enable feature legacy-zip to get support)

const DEFLATE: Self = CompressionMethod::Deflated;
const DEFLATE64: Self = CompressionMethod::Deflate64;
const PKWARE_IMPLODE: Self = _;
const BZIP2: Self = CompressionMethod::Bzip2;
const LZMA: Self = CompressionMethod::Lzma;
const IBM_ZOS_CMPSC: Self = _;
const IBM_TERSE: Self = _;
const ZSTD_DEPRECATED: Self = _;
const ZSTD: Self = CompressionMethod::Zstd;
const MP3: Self = _;
const XZ: Self = CompressionMethod::Xz;
const JPEG: Self = _;
const WAVPACK: Self = _;
const PPMD: Self = CompressionMethod::Ppmd;
const AES: Self = CompressionMethod::Aes;
const DEFAULT: Self = CompressionMethod::Deflated;

impl CompressionMethod

const fn name_from_u16(val: u16) -> &'static str

Convert the compression method (as u16) to a name

const fn from_u16(val: u16) -> CompressionMethod

Converts a u16 to its corresponding CompressionMethod

const fn to_u16(self) -> u16

Converts a CompressionMethod to a u16

const fn into_compression(self) -> Compression

Transform to Compression

Trait Implementations

impl Clone for CompressionMethod

fn clone(&self) -> Self

impl Copy for CompressionMethod

impl Debug for CompressionMethod

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

impl Default for CompressionMethod

fn default() -> Self

impl Display for CompressionMethod

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

impl Eq for CompressionMethod

impl PartialEq for CompressionMethod

fn eq(&self, other: &Self) -> bool

impl StructuralPartialEq for CompressionMethod

Auto Trait Implementations

impl Freeze for CompressionMethod

impl RefUnwindSafe for CompressionMethod

impl Send for CompressionMethod

impl Sync for CompressionMethod

impl Unpin for CompressionMethod

impl UnsafeUnpin for CompressionMethod

impl UnwindSafe for CompressionMethod

Blanket Implementations

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

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

impl<T> Any for CompressionMethod where T: 'static + ?Sized,

impl<T> Borrow<T> for CompressionMethod where T: ?Sized,

impl<T> BorrowMut<T> for CompressionMethod where T: ?Sized,

impl<T> CloneToUninit for CompressionMethod where T: Clone,

impl<T> From<T> for CompressionMethod

impl<T> Same for CompressionMethod

impl<T> ToOwned for CompressionMethod where T: Clone,

impl<T> ToString for CompressionMethod where T: Display + ?Sized,

impl<T, U> Into<U> for CompressionMethod where U: From<T>,

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

impl<T, U> TryInto<U> for CompressionMethod where U: TryFrom<T>,