pub enum Strategy {
Default,
Filtered,
HuffmanOnly,
Rle,
Fixed,
}Expand description
How the compressor looks for matches (zlib’s strategy).
Every strategy writes a valid DEFLATE stream; they trade the search for repeated strings against speed or against data whose redundancy lies elsewhere.
Variants§
Default
The level’s own parsing (Z_DEFAULT_STRATEGY).
Filtered
For filtered image data (Z_FILTERED): the lazy levels 7–9 drop
matches of five bytes or fewer. Pillow writes PNG images with it.
HuffmanOnly
Huffman coding of literals only, no matches (Z_HUFFMAN_ONLY).
Rle
Matches of distance one only, runs of a byte (Z_RLE).
Fixed
The level’s parsing, always written with the fixed Huffman codes
(Z_FIXED).
Trait Implementations§
impl Copy for Strategy
impl Eq for Strategy
impl StructuralPartialEq for Strategy
Auto Trait Implementations§
impl Forget for Strategy
impl Freeze for Strategy
impl Move for Strategy
impl RefUnwindSafe for Strategy
impl Send for Strategy
impl Sync for Strategy
impl Unpin for Strategy
impl UnsafeUnpin for Strategy
impl UnwindSafe for Strategy
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