kona_protocol/compression/config.rs
1//! Compression configuration.
2
3use crate::{CompressionAlgo, CompressorType};
4
5/// Config for the compressor itself.
6#[derive(Debug, Clone)]
7pub struct Config {
8 /// TargetOutputSize is the target size that the compressed data should reach.
9 /// The shadow compressor guarantees that the compressed data stays below
10 /// this bound. The ratio compressor might go over.
11 pub target_output_size: u64,
12 /// ApproxComprRatio to assume (only ratio compressor). Should be slightly smaller
13 /// than average from experiments to avoid the chances of creating a small
14 /// additional leftover frame.
15 pub approx_compr_ratio: f64,
16 /// Kind of compressor to use. Must be one of KindKeys. If unset, NewCompressor
17 /// will default to RatioKind.
18 pub kind: CompressorType,
19
20 /// Type of compression algorithm to use. Must be one of [zlib, brotli-(9|10|11)]
21 pub compression_algo: CompressionAlgo,
22}