pub struct PreflateConfig {
pub min_chunk_size: usize,
pub max_chunk_size: usize,
pub plain_text_limit: usize,
pub total_plain_text_limit: u64,
pub verify: bool,
}
Expand description
Configuration for the deflate process
Fields§
§min_chunk_size: usize
As we scan for deflate streams, we need to have a minimum memory chunk to process. We scan this chunk for deflate streams and at least deflate one block has to fit into a chunk for us to recognize it.
max_chunk_size: usize
The maximum size of a deflate or PNG compressed block we will consider. If a deflate stream is larger than this, we will not decompress it and just write it out as a literal block.
plain_text_limit: usize
The maximum size of a plain text block that we will compress per deflate stream we find. This is in proportion to the min_chunk_size, so as we are decompressing we don’t run out of memory. If we hit this limit, then we will skip this stream and write out the deflate stream without decompressing it.
total_plain_text_limit: u64
The maximum overall size of plain text that we will compress. This is global to the entire container and limits the amount of processing that we will do to avoid running out of CPU time on a single file. Once we hit this limit, we will stop looking for deflate streams and just write out the rest of the data as literal blocks.
verify: bool
Whether we validate the output of the decompression process. This is not necessary if there is a separate verification step since it will just run the verification step twice.
Trait Implementations§
Source§impl Clone for PreflateConfig
impl Clone for PreflateConfig
Source§fn clone(&self) -> PreflateConfig
fn clone(&self) -> PreflateConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more