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-zipto get support)const REDUCE_1: Self = _;Legacy compression method (enable feature
legacy-zipto get support)const REDUCE_2: Self = _;Legacy compression method (enable feature
legacy-zipto get support)const REDUCE_3: Self = _;Legacy compression method (enable feature
legacy-zipto get support)const REDUCE_4: Self = _;Legacy compression method (enable feature
legacy-zipto get support)const IMPLODE: Self = _;Legacy compression method (enable feature
legacy-zipto 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 strConvert the compression method (as
u16) to a nameconst fn from_u16(val: u16) -> CompressionMethodConverts a u16 to its corresponding
CompressionMethodconst fn to_u16(self) -> u16Converts a
CompressionMethodto a u16const fn into_compression(self) -> CompressionTransform 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