Struct Compression
pub struct Compression(/* private field */);
When compressing data, the compression level can be specified by a value in this struct.
Implementations
impl Compression
const fn new(level: u32) -> CompressionCreates a new description of the compression level with an explicitly specified integer.
The integer here is typically on a scale of 0-9 where 0 means "no compression" and 9 means "take as long as you'd like".
const fn none() -> CompressionNo compression is to be performed, this may actually inflate data slightly when encoding.
const fn fast() -> CompressionOptimize for the best speed of encoding.
const fn best() -> CompressionOptimize for the size of data being encoded.
fn level(&self) -> u32Returns an integer representing the compression level, typically on a scale of 0-9. See
newfor details about compression levels.
Trait Implementations
impl Clone for Compression
fn clone(&self) -> Compression
impl Copy for Compression
impl Debug for Compression
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Default for Compression
fn default() -> Compression
impl Eq for Compression
impl PartialEq for Compression
fn eq(&self, other: &Compression) -> bool
impl StructuralPartialEq for Compression
Auto Trait Implementations
impl Freeze for Compression
impl RefUnwindSafe for Compression
impl Send for Compression
impl Sync for Compression
impl Unpin for Compression
impl UnsafeUnpin for Compression
impl UnwindSafe for Compression
Blanket Implementations
impl<T> Any for Compression
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Compression
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Compression
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for Compression
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for Compression
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for Compression
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T, U> Into<U> for Compression
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for Compression
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for Compression
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>