Skip to main content

Mountain/IPC/Enhanced/MessageCompressor/
CompressionInfo.rs

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