Struct DeflateConfig

pub struct DeflateConfig { pub level: i32, pub method: Method, pub window_bits: i32, pub mem_level: i32, pub strategy: Strategy }

Configuration for compression.

Used with compress_slice.

In most cases only the compression level is relevant. We provide three profiles:

Fields

level: i32
method: Method
window_bits: i32
mem_level: i32
strategy: Strategy

Implementations

impl DeflateConfig

fn new(level: i32) -> Self
fn best_compression() -> Self

Configure for the best compression (takes longer).

fn best_speed() -> Self

Configure for the fastest compression (compresses less well).

Trait Implementations

impl Clone for DeflateConfig

fn clone(&self) -> Self

impl Copy for DeflateConfig

impl Debug for DeflateConfig

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

impl Default for DeflateConfig

fn default() -> Self

impl Eq for DeflateConfig

impl Hash for DeflateConfig

fn hash<__H: Hasher>(&self, state: &mut __H)

impl PartialEq for DeflateConfig

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

impl StructuralPartialEq for DeflateConfig

Auto Trait Implementations

impl Freeze for DeflateConfig

impl RefUnwindSafe for DeflateConfig

impl Send for DeflateConfig

impl Sync for DeflateConfig

impl Unpin for DeflateConfig

impl UnsafeUnpin for DeflateConfig

impl UnwindSafe for DeflateConfig

Blanket Implementations

impl<T> Any for DeflateConfig where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for DeflateConfig where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for DeflateConfig where T: ?Sized,

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

impl<T> CloneToUninit for DeflateConfig where T: Clone,

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

impl<T> From<T> for DeflateConfig

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for DeflateConfig where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

impl<T, U> Into<U> for DeflateConfig where U: From<T>,

fn into(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<U> for DeflateConfig where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for DeflateConfig where U: TryFrom<T>,

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