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;
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Inflater
impl Send for Inflater
impl Sync for Inflater
impl Unpin for Inflater
impl UnwindSafe for Inflater
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more