pub struct EncoderParams { /* private fields */ }Available on
async_compression_unstable and crate feature brotli-mbrotli only.Expand description
Brotli compression parameters builder for the mbrotli backend. This is a stable wrapper
around mbrotli’s own encoder configuration, to abstract over different versions of the mbrotli
library.
The builder methods mirror brotli::params::EncoderParams where the two backends overlap, so
switching between them only needs a type change.
See the Brotli documentation for more information on these parameters.
§Examples
use compression_codecs::mbrotli;
let params = mbrotli::params::EncoderParams::default()
.window_size(12)
.text_mode();Implementations§
Source§impl EncoderParams
impl EncoderParams
pub fn quality(self, level: Level) -> Self
Sourcepub fn window_size(self, window_size: i32) -> Self
pub fn window_size(self, window_size: i32) -> Self
Sets window size in bytes (as a power of two).
Used as Brotli’s lgwin parameter.
window_size is clamped to 10 <= window_size <= 24, except 0 which selects the default
window, as the brotli backend does.
Sourcepub fn block_size(self, block_size: i32) -> Self
pub fn block_size(self, block_size: i32) -> Self
Sets input block size in bytes (as a power of two).
Used as Brotli’s lgblock parameter.
block_size is clamped to 16 <= block_size <= 24.
Trait Implementations§
Source§impl Clone for EncoderParams
impl Clone for EncoderParams
impl Copy for EncoderParams
Source§impl Debug for EncoderParams
impl Debug for EncoderParams
Auto Trait Implementations§
impl Freeze for EncoderParams
impl RefUnwindSafe for EncoderParams
impl Send for EncoderParams
impl Sync for EncoderParams
impl Unpin for EncoderParams
impl UnsafeUnpin for EncoderParams
impl UnwindSafe for EncoderParams
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