pub enum CompressionMethod {
Deflate,
Unknown(u16),
}Expand description
Represents a ZIP compression method. See CompressionMethod::create_decompressor
Variants§
Implementations§
Source§impl CompressionMethod
impl CompressionMethod
Sourcepub fn from_id(id: u16) -> Option<Self>
pub fn from_id(id: u16) -> Option<Self>
Tries to turn a ZIP compression id into a CompressionMethod variant.
Returns None if the id is 0, CompressionMethod::Unknown if a decompressor for it is not available
Sourcepub fn create_decompressor(
&self,
) -> Result<Box<dyn Decompressor>, DecompressorCreationError>
pub fn create_decompressor( &self, ) -> Result<Box<dyn Decompressor>, DecompressorCreationError>
Tries to create a Decompressor for this CompressionMethod
Returns error if it is CompressionMethod::Unknown
Sourcepub fn is_supported(&self) -> bool
pub fn is_supported(&self) -> bool
Returns whether decompression is supported for this method
Trait Implementations§
Source§impl Clone for CompressionMethod
impl Clone for CompressionMethod
Source§fn clone(&self) -> CompressionMethod
fn clone(&self) -> CompressionMethod
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto 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
Mutably borrows from an owned value. Read more