pub struct CompressionStats {
pub original_size: usize,
pub compressed_size: usize,
pub ratio: f64,
pub space_saved: usize,
pub compression_type: CompressionType,
pub level: CompressionLevel,
}
Expand description
Compression statistics
Fields§
§original_size: usize
Original data size
compressed_size: usize
Compressed data size
ratio: f64
Compression ratio (compressed/original)
space_saved: usize
Space saved in bytes
compression_type: CompressionType
Compression type used
level: CompressionLevel
Compression level used
Implementations§
Source§impl CompressionStats
impl CompressionStats
Sourcepub fn calculate(
original_size: usize,
compressed_size: usize,
compression_type: CompressionType,
level: CompressionLevel,
) -> Self
pub fn calculate( original_size: usize, compressed_size: usize, compression_type: CompressionType, level: CompressionLevel, ) -> Self
Calculate statistics for a compression operation
Sourcepub fn ratio_percent(&self) -> f64
pub fn ratio_percent(&self) -> f64
Get compression ratio as percentage
Sourcepub fn space_saved_percent(&self) -> f64
pub fn space_saved_percent(&self) -> f64
Get space saved as percentage
Trait Implementations§
Source§impl Clone for CompressionStats
impl Clone for CompressionStats
Source§fn clone(&self) -> CompressionStats
fn clone(&self) -> CompressionStats
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 moreAuto Trait Implementations§
impl Freeze for CompressionStats
impl RefUnwindSafe for CompressionStats
impl Send for CompressionStats
impl Sync for CompressionStats
impl Unpin for CompressionStats
impl UnwindSafe for CompressionStats
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