Struct libdeflater::CompressionLvl
source · [−]pub struct CompressionLvl(_);
Expand description
Compression level used by a Compressor
instance.
Implementations
sourceimpl CompressionLvl
impl CompressionLvl
sourcepub fn new(level: i32) -> Result<CompressionLvl, CompressionLvlError>
pub fn new(level: i32) -> Result<CompressionLvl, CompressionLvlError>
Try to create a valid
CompressionLvl
from a numeric
value.
If level
is a valid custom compression level for libdeflate,
returns a Result::Ok(CompressionLvl)
. Otherwise, returns
Result::Error(error)
.
Valid compression levels for libdeflate, at time of writing, are 1-12.
sourcepub fn fastest() -> CompressionLvl
pub fn fastest() -> CompressionLvl
Returns the fastest compression level. This compression level offers the highest performance but lowest compression ratio.
sourcepub fn best() -> CompressionLvl
pub fn best() -> CompressionLvl
Returns the best compression level, in terms of compression ratio. This compression level offers the best compression ratio but lowest performance.
sourcepub fn iter() -> CompressionLvlIterⓘNotable traits for CompressionLvlIterimpl Iterator for CompressionLvlIter type Item = CompressionLvl;
pub fn iter() -> CompressionLvlIterⓘNotable traits for CompressionLvlIterimpl Iterator for CompressionLvlIter type Item = CompressionLvl;
Returns an iterator that emits all compression levels
supported by libdeflate
in ascending order.
Trait Implementations
sourceimpl Clone for CompressionLvl
impl Clone for CompressionLvl
sourcefn clone(&self) -> CompressionLvl
fn clone(&self) -> CompressionLvl
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for CompressionLvl
impl Debug for CompressionLvl
sourceimpl Default for CompressionLvl
impl Default for CompressionLvl
sourcefn default() -> CompressionLvl
fn default() -> CompressionLvl
Returns the default compression level reccomended by libdeflate.
sourceimpl From<&CompressionLvl> for i32
impl From<&CompressionLvl> for i32
sourcefn from(level: &CompressionLvl) -> Self
fn from(level: &CompressionLvl) -> Self
Converts to this type from the input type.
sourceimpl From<CompressionLvl> for i32
impl From<CompressionLvl> for i32
sourcefn from(level: CompressionLvl) -> Self
fn from(level: CompressionLvl) -> Self
Converts to this type from the input type.
sourceimpl Ord for CompressionLvl
impl Ord for CompressionLvl
sourcefn cmp(&self, other: &CompressionLvl) -> Ordering
fn cmp(&self, other: &CompressionLvl) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<CompressionLvl> for CompressionLvl
impl PartialEq<CompressionLvl> for CompressionLvl
sourcefn eq(&self, other: &CompressionLvl) -> bool
fn eq(&self, other: &CompressionLvl) -> bool
sourceimpl PartialOrd<CompressionLvl> for CompressionLvl
impl PartialOrd<CompressionLvl> for CompressionLvl
sourcefn partial_cmp(&self, other: &CompressionLvl) -> Option<Ordering>
fn partial_cmp(&self, other: &CompressionLvl) -> Option<Ordering>
1.0.0 · sourcefn 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 moreimpl Copy for CompressionLvl
impl Eq for CompressionLvl
impl StructuralEq for CompressionLvl
impl StructuralPartialEq for CompressionLvl
Auto Trait Implementations
impl RefUnwindSafe for CompressionLvl
impl Send for CompressionLvl
impl Sync for CompressionLvl
impl Unpin for CompressionLvl
impl UnwindSafe for CompressionLvl
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more