pub struct DeflateConfig {
pub level: i32,
pub method: Method,
pub window_bits: i32,
pub mem_level: i32,
pub strategy: Strategy,
}Expand description
Configuration for compression.
Used with compress_slice.
In most cases only the compression level is relevant. We provide three profiles:
DeflateConfig::best_speedprovides the fastest compression (at the cost of compression quality)DeflateConfig::defaulttries to find a happy middleDeflateConfig::best_compressionprovides the best compression (at the cost of longer runtime)
Fields§
§level: i32§method: Method§window_bits: i32§mem_level: i32§strategy: StrategyImplementations§
Source§impl DeflateConfig
impl DeflateConfig
pub fn new(level: i32) -> Self
Sourcepub fn best_compression() -> Self
pub fn best_compression() -> Self
Configure for the best compression (takes longer).
Sourcepub fn best_speed() -> Self
pub fn best_speed() -> Self
Configure for the fastest compression (compresses less well).
Trait Implementations§
Source§impl Clone for DeflateConfig
impl Clone for DeflateConfig
Source§fn clone(&self) -> DeflateConfig
fn clone(&self) -> DeflateConfig
Returns a duplicate 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 DeflateConfig
impl Debug for DeflateConfig
Source§impl Default for DeflateConfig
impl Default for DeflateConfig
Source§impl Hash for DeflateConfig
impl Hash for DeflateConfig
Source§impl PartialEq for DeflateConfig
impl PartialEq for DeflateConfig
impl Copy for DeflateConfig
impl Eq for DeflateConfig
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 UnwindSafe for DeflateConfig
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