pub struct EncoderParams { /* private fields */ }
Available on crate feature
brotli
only.Expand description
Brotli compression parameters builder. This is a stable wrapper around Brotli’s own encoder params type, to abstract over different versions of the Brotli library.
See the Brotli documentation for more information on these parameters.
§Examples
use compression_codecs::brotli;
let params = brotli::params::EncoderParams::default()
.window_size(12)
.text_mode();
Implementations§
Source§impl EncoderParams
impl EncoderParams
pub fn quality(self, level: Level) -> EncoderParams
Sourcepub fn window_size(self, window_size: i32) -> EncoderParams
pub fn window_size(self, window_size: i32) -> EncoderParams
Sets window size in bytes (as a power of two).
Used as Brotli’s lgwin
parameter.
window_size
is clamped to 0 <= window_size <= 24
.
Sourcepub fn block_size(self, block_size: i32) -> EncoderParams
pub fn block_size(self, block_size: i32) -> EncoderParams
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
.
Sourcepub fn size_hint(self, size_hint: usize) -> EncoderParams
pub fn size_hint(self, size_hint: usize) -> EncoderParams
Sets hint for size of data to be compressed.
Sourcepub fn text_mode(self) -> EncoderParams
pub fn text_mode(self) -> EncoderParams
Sets encoder to text mode.
If input data is known to be UTF-8 text, this allows the compressor to make assumptions and optimizations.
Used as Brotli’s mode
parameter.
pub fn mode(self, mode: BrotliEncoderMode) -> EncoderParams
Trait Implementations§
Source§impl Clone for EncoderParams
impl Clone for EncoderParams
Source§fn clone(&self) -> EncoderParams
fn clone(&self) -> EncoderParams
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 EncoderParams
impl Debug for EncoderParams
Source§impl Default for EncoderParams
impl Default for EncoderParams
Source§fn default() -> EncoderParams
fn default() -> EncoderParams
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for EncoderParams
impl RefUnwindSafe for EncoderParams
impl Send for EncoderParams
impl Sync for EncoderParams
impl Unpin 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