Mountain/IPC/Enhanced/MessageCompressor/CompressionInfo.rs
1
2//! Per-batch compression metadata - algorithm name, level,
3//! and the achieved ratio. `none()` produces the
4//! uncompressed sentinel (`algorithm:"none"`, `ratio:1.0`).
5
6use serde::{Deserialize, Serialize};
7
8#[derive(Debug, Clone, Serialize, Deserialize)]
9pub struct Struct {
10 pub algorithm:String,
11
12 pub level:u32,
13
14 pub ratio:f64,
15}
16
17impl Struct {
18 pub(super) fn none() -> Self { Self { algorithm:"none".to_string(), level:0, ratio:1.0 } }
19}