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 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§impl PartialOrd for CompressionLevel
impl PartialOrd for CompressionLevel
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