Struct async_compression::brotli::EncoderParams
source · pub struct EncoderParams {
window_size: Option<i32>,
block_size: Option<i32>,
size_hint: Option<usize>,
mode: Option<BrotliEncoderMode>,
}
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 async_compression::brotli;
let params = brotli::EncoderParams::default()
.window_size(12)
.text_mode();
Fields§
§window_size: Option<i32>
§block_size: Option<i32>
§size_hint: Option<usize>
§mode: Option<BrotliEncoderMode>
Implementations§
source§impl EncoderParams
impl EncoderParams
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 0 <= window_size <= 24
.
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
.
sourcepub fn text_mode(self) -> Self
pub fn text_mode(self) -> Self
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(crate) fn as_brotli(&self) -> BrotliEncoderParams
Trait Implementations§
source§impl Clone for EncoderParams
impl Clone for EncoderParams
source§fn clone(&self) -> EncoderParams
fn clone(&self) -> EncoderParams
Returns a copy 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
source§impl PartialEq for EncoderParams
impl PartialEq for EncoderParams
source§fn eq(&self, other: &EncoderParams) -> bool
fn eq(&self, other: &EncoderParams) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for EncoderParams
impl Eq for EncoderParams
impl StructuralPartialEq 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 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