Struct Compression

struct Compression(_)

When compressing data, the compression level can be specified by a value in this struct.

Implementations

impl Compression

const fn new(level: u32) -> Compression

Creates 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() -> Compression

No compression is to be performed, this may actually inflate data slightly when encoding.

const fn fast() -> Compression

Optimize for the best speed of encoding.

const fn best() -> Compression

Optimize for the size of data being encoded.

fn level(self: &Self) -> u32

Returns an integer representing the compression level, typically on a scale of 0-9. See new for details about compression levels.

impl Clone for Compression

fn clone(self: &Self) -> Compression

impl Copy for Compression

impl Debug for Compression

fn fmt(self: &Self, f: &mut $crate::fmt::Formatter<'_>) -> $crate::fmt::Result

impl Default for Compression

fn default() -> Compression

impl Eq for Compression

impl Freeze for Compression

impl PartialEq for Compression

fn eq(self: &Self, other: &Compression) -> bool

impl RefUnwindSafe for Compression

impl Send for Compression

impl StructuralPartialEq for Compression

impl Sync for Compression

impl Unpin for Compression

impl UnwindSafe for Compression

impl<T> Any for Compression

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Compression

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for Compression

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> CloneToUninit for Compression

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> From for Compression

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for Compression

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T, U> Into for Compression

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for Compression

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for Compression

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>