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() -> DataCompression
pub const fn zstd() -> DataCompression
Create Zstd compression with default level
Sourcepub const fn zstd_level(level: u8) -> DataCompression
pub const fn zstd_level(level: u8) -> DataCompression
Create Zstd compression with custom level
Sourcepub const fn delta_zstd() -> DataCompression
pub const fn delta_zstd() -> DataCompression
Create delta+Zstd compression
Sourcepub const fn quantized(bits: u8) -> DataCompression
pub const fn quantized(bits: u8) -> DataCompression
Create quantized entropy compression
Sourcepub fn sparse(threshold: f32) -> DataCompression
pub fn sparse(threshold: f32) -> DataCompression
Create sparse compression with threshold
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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for DataCompression
Source§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
impl Eq for DataCompression
Source§impl PartialEq for DataCompression
impl PartialEq 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 UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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§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<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§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