Enum stream_unpack::zip::structures::CompressionMethod
source · 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 copy 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 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