pub struct Options { /* private fields */ }Expand description
Everything that decides the compressed bytes of an input, as zlib’s
deflateInit2 takes it (with a 32 KiB window).
use pltrs_codec::CompressionLevel;
use pltrs_codec::deflate::{self, MemoryLevel, Options, Strategy};
let options = Options::new(CompressionLevel::BEST)
.strategy(Strategy::Filtered)
.memory_level(MemoryLevel::MAX);
let packed = deflate::compress_with(b"abcabcabcabcabc", options)?;
assert_eq!(deflate::decompress(&packed)?, b"abcabcabcabcabc");Implementations§
Source§impl Options
impl Options
Sourcepub const fn new(level: CompressionLevel) -> Self
pub const fn new(level: CompressionLevel) -> Self
The options zlib’s deflateInit gives level: the default
strategy and memory level.
Sourcepub const fn memory_level(self, memory_level: MemoryLevel) -> Self
pub const fn memory_level(self, memory_level: MemoryLevel) -> Self
Sets the memory level.
Trait Implementations§
impl Copy for Options
impl Eq for Options
impl StructuralPartialEq for Options
Auto Trait Implementations§
impl Forget for Options
impl Freeze for Options
impl Move for Options
impl RefUnwindSafe for Options
impl Send for Options
impl Sync for Options
impl Unpin for Options
impl UnsafeUnpin for Options
impl UnwindSafe for Options
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