[−][src]Trait barc::CompressStrategy
Strategies for BARC record compression encoding on write.
Required methods
pub fn wrap_encoder<'a>(
&self,
rec: &dyn MetaRecorded,
file: &'a File
) -> Result<EncodeWrapper<'a>, BarcError>
[src]
&self,
rec: &dyn MetaRecorded,
file: &'a File
) -> Result<EncodeWrapper<'a>, BarcError>
Return an EncodeWrapper
for File
by evaluating the
MetaRecorded
for compression worthiness.
Provided methods
pub fn min_len(&self) -> u64
[src]
Return minimum length of compressible bytes for compression.
pub fn non_compressible_coef(&self) -> f64
[src]
Return a coefficient used to weight the discount of non-compressible body bytes. Default: 0.5
pub fn check_identity(&self) -> bool
[src]
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)
pub fn is_compressible(&self, rec: &dyn MetaRecorded) -> bool
[src]
Return true if the provided record has at least min_len
of
compressible bytes, from the response and request bodies and
headers.
Any non-compressible bytes, from non-compressible bodies, are
discounted, weighted by non_compressible_coef
.
Implementors
impl CompressStrategy for BrotliCompressStrategy
[src]
pub fn wrap_encoder<'a>(
&self,
rec: &dyn MetaRecorded,
file: &'a File
) -> Result<EncodeWrapper<'a>, BarcError>
[src]
&self,
rec: &dyn MetaRecorded,
file: &'a File
) -> Result<EncodeWrapper<'a>, BarcError>
pub fn min_len(&self) -> u64
[src]
pub fn check_identity(&self) -> bool
[src]
impl CompressStrategy for GzipCompressStrategy
[src]
pub fn wrap_encoder<'a>(
&self,
rec: &dyn MetaRecorded,
file: &'a File
) -> Result<EncodeWrapper<'a>, BarcError>
[src]
&self,
rec: &dyn MetaRecorded,
file: &'a File
) -> Result<EncodeWrapper<'a>, BarcError>
pub fn min_len(&self) -> u64
[src]
pub fn check_identity(&self) -> bool
[src]
impl CompressStrategy for NoCompressStrategy
[src]
pub fn wrap_encoder<'a>(
&self,
_rec: &dyn MetaRecorded,
file: &'a File
) -> Result<EncodeWrapper<'a>, BarcError>
[src]
&self,
_rec: &dyn MetaRecorded,
file: &'a File
) -> Result<EncodeWrapper<'a>, BarcError>
Return an EncodeWrapper
for File
. This implementation
always returns a Plain
wrapper.