pub struct StreamingStats {
pub bytes_read: u64,
pub bytes_written: u64,
}Expand description
Statistics for streaming compression/decompression
Fields§
§bytes_read: u64Total bytes read from source
bytes_written: u64Total bytes written (compressed/decompressed)
Implementations§
Source§impl StreamingStats
impl StreamingStats
Sourcepub fn compression_ratio(&self) -> f64
pub fn compression_ratio(&self) -> f64
Calculate the compression ratio (compressed_size / original_size)
Returns 1.0 if no data has been processed.
Sourcepub fn bytes_saved(&self) -> i64
pub fn bytes_saved(&self) -> i64
Calculate space saved (in bytes)
Sourcepub fn savings_percent(&self) -> f64
pub fn savings_percent(&self) -> f64
Calculate space saved as a percentage
Trait Implementations§
Source§impl Clone for StreamingStats
impl Clone for StreamingStats
Source§fn clone(&self) -> StreamingStats
fn clone(&self) -> StreamingStats
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StreamingStats
impl Debug for StreamingStats
Source§impl Default for StreamingStats
impl Default for StreamingStats
Source§fn default() -> StreamingStats
fn default() -> StreamingStats
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for StreamingStats
impl RefUnwindSafe for StreamingStats
impl Send for StreamingStats
impl Sync for StreamingStats
impl Unpin for StreamingStats
impl UnwindSafe for StreamingStats
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more