pub struct BrotliCompressStrategy { /* private fields */ }Expand description
Strategy for Brotli compression.
Will only compress if a minimum length of compressible bytes, from the response and request bodies and headers is found.
Implementations§
Source§impl BrotliCompressStrategy
impl BrotliCompressStrategy
Sourcepub fn set_min_len(self, size: u64) -> Self
pub fn set_min_len(self, size: u64) -> Self
Set minimum length of compressible bytes required to use compression. Default: 1 KiB.
Sourcepub fn set_compression_level(self, level: u32) -> Self
pub fn set_compression_level(self, level: u32) -> Self
Set the compression level to use, typically on a scale of 0-9 where 0 is no compression and 9 is highest (and slowest) compression. Default: 6.
Sourcepub fn set_check_identity(self, check: bool) -> Self
pub fn set_check_identity(self, check: bool) -> Self
Set whether to check the meta -decoded header for an “identity” value, as proof that the content-type header actually characterizes the associated body.
For example, body_image_futio::decode_res_body as of crate version
1.1.0, will set this value on an original Dialog, which is preserved
when converted to a Record for barc write.
Default: true (changed in 2.0.0)
Trait Implementations§
Source§impl Clone for BrotliCompressStrategy
impl Clone for BrotliCompressStrategy
Source§fn clone(&self) -> BrotliCompressStrategy
fn clone(&self) -> BrotliCompressStrategy
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 CompressStrategy for BrotliCompressStrategy
impl CompressStrategy for BrotliCompressStrategy
Source§fn wrap_encoder<'a>(
&self,
rec: &dyn MetaRecorded,
file: &'a File,
) -> Result<EncodeWrapper<'a>, BarcError>
fn wrap_encoder<'a>( &self, rec: &dyn MetaRecorded, file: &'a File, ) -> Result<EncodeWrapper<'a>, BarcError>
Return an
EncodeWrapper for File by evaluating the
MetaRecorded for compression worthiness.Source§fn check_identity(&self) -> bool
fn check_identity(&self) -> bool
Return whether to check the meta -decoded header for an “identity”
value, as proof that the content-type header actually characterizes
the associated body, for the purpose of counting compressible bytes.
Default: false (may change in the future)
Source§fn non_compressible_coef(&self) -> f64
fn non_compressible_coef(&self) -> f64
Return a coefficient used to weight the discount of non-compressible
body bytes. Default: 0.5
Source§fn is_compressible(&self, rec: &dyn MetaRecorded) -> bool
fn is_compressible(&self, rec: &dyn MetaRecorded) -> bool
Return true if the provided record has at least
min_len of
compressible bytes, from the response and request bodies and
headers. Read moreSource§impl Debug for BrotliCompressStrategy
impl Debug for BrotliCompressStrategy
Source§impl Default for BrotliCompressStrategy
impl Default for BrotliCompressStrategy
impl Copy for BrotliCompressStrategy
Auto Trait Implementations§
impl Freeze for BrotliCompressStrategy
impl RefUnwindSafe for BrotliCompressStrategy
impl Send for BrotliCompressStrategy
impl Sync for BrotliCompressStrategy
impl Unpin for BrotliCompressStrategy
impl UnwindSafe for BrotliCompressStrategy
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