pub struct GroupComparisonMetrics {
pub lz_matches: u64,
pub entropy: f64,
pub estimated_size: u64,
pub zstd_size: u64,
pub original_size: u64,
}
Expand description
The statistics for a given group of fields.
This can be a group created by the split_comparison
module, the
compare_groups
module or any other piece of code that compares multiple sets of bytes.
Fields§
§lz_matches: u64
Number of total LZ matches
entropy: f64
Amount of entropy in the input data set
estimated_size: u64
Size estimated by the size estimator function.
zstd_size: u64
Size compressed by zstd.
original_size: u64
Size of the original data.
Implementations§
Source§impl GroupComparisonMetrics
impl GroupComparisonMetrics
Sourcepub fn from_bytes(
bytes: &[u8],
group_name: &str,
compression_options: CompressionOptions,
) -> Self
pub fn from_bytes( bytes: &[u8], group_name: &str, compression_options: CompressionOptions, ) -> Self
Calculates group comparison metrics for a given byte slice.
This function computes various metrics such as entropy, LZ matches, estimated size, and Zstandard compressed size, which are used for comparing different compression strategies.
§Arguments
bytes
- A slice of bytes representing the data to analyze.group_name
- The name of the group being analyzed.compression_options
- Compression options, zstd compression level, etc.
§Returns
A GroupComparisonMetrics
struct containing the computed metrics.
Trait Implementations§
Source§impl Clone for GroupComparisonMetrics
impl Clone for GroupComparisonMetrics
Source§fn clone(&self) -> GroupComparisonMetrics
fn clone(&self) -> GroupComparisonMetrics
Returns a copy 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 GroupComparisonMetrics
impl Debug for GroupComparisonMetrics
Source§impl Default for GroupComparisonMetrics
impl Default for GroupComparisonMetrics
Source§fn default() -> GroupComparisonMetrics
fn default() -> GroupComparisonMetrics
Returns the “default value” for a type. Read more
Source§impl PartialEq for GroupComparisonMetrics
impl PartialEq for GroupComparisonMetrics
impl Copy for GroupComparisonMetrics
impl StructuralPartialEq for GroupComparisonMetrics
Auto Trait Implementations§
impl Freeze for GroupComparisonMetrics
impl RefUnwindSafe for GroupComparisonMetrics
impl Send for GroupComparisonMetrics
impl Sync for GroupComparisonMetrics
impl Unpin for GroupComparisonMetrics
impl UnwindSafe for GroupComparisonMetrics
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