#[non_exhaustive]pub enum CompressionMethod {
}Expand description
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 (Non-exhaustive)§
This enum is marked as non-exhaustive
Stored
Store the file as is
Deflated
_deflate-any only.Compress the file using Deflate
Deflate64
deflate64 only.Compress the file using Deflate64. Decoding deflate64 is supported but encoding deflate64 is not supported.
Bzip2
bzip2 only.Compress the file using BZIP2
Aes
aes-crypto only.Encrypted using AES.
The actual compression method has to be taken from the AES extra data field
or from ZipFileData.
Zstd
zstd only.Compress the file using ZStandard
Lzma
lzma only.Compress the file using LZMA
Shrink
legacy-zip only.Method 1 Shrink
Reduce(u8)
legacy-zip only.Reduce (Method 2-5)
Implode
legacy-zip only.Method 6 Implode/explode
Xz
xz only.Compress the file using XZ
Ppmd
ppmd only.Compress the file using PPMd
Unsupported(u16)
Unsupported compression method
Implementations§
Source§impl CompressionMethod
All compression methods defined for the ZIP format
impl CompressionMethod
All compression methods defined for the ZIP format
pub const STORE: Self = CompressionMethod::Stored
pub const SHRINK: Self = CompressionMethod::Shrink
legacy-zip only.Sourcepub const IMPLODE: Self = CompressionMethod::Implode
Available on crate feature legacy-zip only.
pub const IMPLODE: Self = CompressionMethod::Implode
legacy-zip only.Legacy compression method
pub const DEFLATE: Self = CompressionMethod::Deflated
_deflate-any only.pub const DEFLATE64: Self = CompressionMethod::Deflate64
deflate64 only.pub const PKWARE_IMPLODE: Self
pub const BZIP2: Self = CompressionMethod::Bzip2
bzip2 only.pub const LZMA: Self = CompressionMethod::Lzma
lzma only.pub const IBM_ZOS_CMPSC: Self
pub const IBM_TERSE: Self
pub const ZSTD_DEPRECATED: Self
pub const ZSTD: Self = CompressionMethod::Zstd
zstd only.pub const MP3: Self
pub const XZ: Self = CompressionMethod::Xz
xz only.pub const JPEG: Self
pub const WAVPACK: Self
pub const PPMD: Self = CompressionMethod::Ppmd
ppmd only.pub const AES: Self = CompressionMethod::Aes
aes-crypto only.Source§impl CompressionMethod
impl CompressionMethod
Sourcepub const fn from_u16(val: u16) -> CompressionMethod
👎Deprecated since 0.5.7: use a constant to construct a compression method
pub const fn from_u16(val: u16) -> CompressionMethod
Converts a u16 to its corresponding CompressionMethod
Trait Implementations§
Source§impl Clone for CompressionMethod
impl Clone for CompressionMethod
Source§fn clone(&self) -> CompressionMethod
fn clone(&self) -> CompressionMethod
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CompressionMethod
impl Debug for CompressionMethod
Source§impl Default for CompressionMethod
impl Default for CompressionMethod
Source§impl Display for CompressionMethod
impl Display for CompressionMethod
Source§impl PartialEq for CompressionMethod
impl PartialEq for CompressionMethod
impl Copy for CompressionMethod
impl Eq for CompressionMethod
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 UnwindSafe for CompressionMethod
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.