Struct barc::BrotliCompressStrategy [−][src]
pub struct BrotliCompressStrategy { /* fields omitted */ }
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
Set minimum length of compressible bytes required to use compression. Default: 1 KiB.
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.
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
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. Read more
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) Read more
Return a coefficient used to weight the discount of non-compressible body bytes. Default: 0.5 Read more
Return true if the provided record has at least min_len
of
compressible bytes, from the response and request bodies and
headers. Read more
Auto Trait Implementations
impl RefUnwindSafe for BrotliCompressStrategy
impl Send for BrotliCompressStrategy
impl Sync for BrotliCompressStrategy
impl Unpin for BrotliCompressStrategy
impl UnwindSafe for BrotliCompressStrategy
Blanket Implementations
Mutably borrows from an owned value. Read more