pub enum DataCompression {
None,
Zstd {
level: u8,
},
DeltaZstd {
level: u8,
},
QuantizedEntropy {
bits: u8,
},
Sparse {
threshold: u32,
},
}Expand description
Data compression strategy (spec §4.2)
Selects optimal compression based on data characteristics:
- None: Raw f32 values, zero latency
- Zstd: General purpose, 2-10x ratio
DeltaZstd: Time series/sorted data, 5-20x ratioQuantizedEntropy: ML-specific, 4-8x with minimal accuracy loss- Sparse: Sparse features, ratio proportional to sparsity
Variants§
None
No compression (raw f32 values)
Zstd
Zstd compression (general purpose) Ratio: 2-10x, Speed: 500 MB/s decompress
DeltaZstd
Delta encoding + Zstd (time series, sorted data) Ratio: 5-20x for sequential data
QuantizedEntropy
Quantization + entropy coding (ML-specific) Ratio: 4-8x with minimal accuracy loss
Sparse
Sparse representation (for sparse features) Ratio: proportional to sparsity
Implementations§
Source§impl DataCompression
impl DataCompression
Sourcepub const fn zstd_level(level: u8) -> Self
pub const fn zstd_level(level: u8) -> Self
Create Zstd compression with custom level
Sourcepub const fn delta_zstd() -> Self
pub const fn delta_zstd() -> Self
Create delta+Zstd compression
Sourcepub const fn estimated_ratio(&self) -> f32
pub const fn estimated_ratio(&self) -> f32
Estimated compression ratio (typical)
Trait Implementations§
Source§impl Clone for DataCompression
impl Clone for DataCompression
Source§fn clone(&self) -> DataCompression
fn clone(&self) -> DataCompression
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 DataCompression
impl Debug for DataCompression
Source§impl Default for DataCompression
impl Default for DataCompression
Source§fn default() -> DataCompression
fn default() -> DataCompression
Returns the “default value” for a type. Read more
Source§impl PartialEq for DataCompression
impl PartialEq for DataCompression
impl Copy for DataCompression
impl Eq for DataCompression
impl StructuralPartialEq for DataCompression
Auto Trait Implementations§
impl Freeze for DataCompression
impl RefUnwindSafe for DataCompression
impl Send for DataCompression
impl Sync for DataCompression
impl Unpin for DataCompression
impl UnwindSafe for DataCompression
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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