pub struct RunLengthAnalyzer;Expand description
Analyzes data to determine if run-length encoding is beneficial.
Implementations§
Source§impl RunLengthAnalyzer
impl RunLengthAnalyzer
Sourcepub fn estimate_ratio(values: &[u64]) -> f64
pub fn estimate_ratio(values: &[u64]) -> f64
Estimates the compression ratio without actually encoding.
This is faster than encoding for decision-making.
Sourcepub fn is_beneficial(values: &[u64]) -> bool
pub fn is_beneficial(values: &[u64]) -> bool
Returns true if run-length encoding would be beneficial.
Sourcepub fn average_run_length(values: &[u64]) -> f64
pub fn average_run_length(values: &[u64]) -> f64
Returns the average run length in the data.
Auto Trait Implementations§
impl Freeze for RunLengthAnalyzer
impl RefUnwindSafe for RunLengthAnalyzer
impl Send for RunLengthAnalyzer
impl Sync for RunLengthAnalyzer
impl Unpin for RunLengthAnalyzer
impl UnwindSafe for RunLengthAnalyzer
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