Struct async_mtzip::level::CompressionLevel
source · pub struct CompressionLevel(/* private fields */);Expand description
Compression level that should be used when compressing a file or data.
Current compression providers support only levels from 0 to 9, so these are the only ones being supported.
Implementations§
source§impl CompressionLevel
impl CompressionLevel
sourcepub const fn new(level: u8) -> Option<Self>
pub const fn new(level: u8) -> Option<Self>
Construct a new value of a compression level setting.
The integer value must be less than or equal to 9, otherwise None is returned
sourcepub const unsafe fn new_unchecked(level: u8) -> Self
pub const unsafe fn new_unchecked(level: u8) -> Self
Construct a new value of a compression level setting without checking the value.
§Safety
The value must be a valid supported compression level
Trait Implementations§
source§impl Clone for CompressionLevel
impl Clone for CompressionLevel
source§fn clone(&self) -> CompressionLevel
fn clone(&self) -> CompressionLevel
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 moresource§impl Debug for CompressionLevel
impl Debug for CompressionLevel
source§impl Default for CompressionLevel
impl Default for CompressionLevel
source§fn default() -> Self
fn default() -> Self
Equivalent to Self::balanced
source§impl From<CompressionLevel> for Compression
impl From<CompressionLevel> for Compression
source§fn from(value: CompressionLevel) -> Self
fn from(value: CompressionLevel) -> Self
Converts to this type from the input type.
source§impl From<CompressionLevel> for u8
impl From<CompressionLevel> for u8
source§fn from(value: CompressionLevel) -> Self
fn from(value: CompressionLevel) -> Self
Converts to this type from the input type.
source§impl Ord for CompressionLevel
impl Ord for CompressionLevel
source§fn cmp(&self, other: &CompressionLevel) -> Ordering
fn cmp(&self, other: &CompressionLevel) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for CompressionLevel
impl PartialEq for CompressionLevel
source§fn eq(&self, other: &CompressionLevel) -> bool
fn eq(&self, other: &CompressionLevel) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialOrd for CompressionLevel
impl PartialOrd for CompressionLevel
source§fn partial_cmp(&self, other: &CompressionLevel) -> Option<Ordering>
fn partial_cmp(&self, other: &CompressionLevel) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresource§impl TryFrom<Compression> for CompressionLevel
impl TryFrom<Compression> for CompressionLevel
§type Error = InvalidCompressionLevel
type Error = InvalidCompressionLevel
The type returned in the event of a conversion error.
source§impl TryFrom<u8> for CompressionLevel
impl TryFrom<u8> for CompressionLevel
impl Copy for CompressionLevel
impl Eq for CompressionLevel
impl StructuralPartialEq for CompressionLevel
Auto Trait Implementations§
impl Freeze for CompressionLevel
impl RefUnwindSafe for CompressionLevel
impl Send for CompressionLevel
impl Sync for CompressionLevel
impl Unpin for CompressionLevel
impl UnwindSafe for CompressionLevel
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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more