Struct twilight_gateway::Inflater
source · pub struct Inflater { /* private fields */ }
Available on crate features
zlib-stock
or zlib-simd
only.Expand description
Gateway event decompressor.
Each received compressed event gets inflated into a String
who’s input
and output size is recorded.
Example
Calculate the percentage bytes saved:
let inflater = shard.inflater();
let total_percentage_compressed =
inflater.processed() as f64 * 100.0 / inflater.produced() as f64;
let total_percentage_saved = 100.0 - total_percentage_compressed;