pub struct DeltaMetadata {
pub base_hash: String,
pub chain_depth: u32,
pub original_size: usize,
pub delta_size: usize,
pub is_delta: bool,
pub similarity: f64,
pub space_savings: f64,
}Expand description
Delta encoding metadata
Tracks base references, chain depth, and compression statistics
Fields§
§base_hash: StringHash of the base version used for this delta
chain_depth: u32Chain depth (0 = full version, >0 = delta)
original_size: usizeOriginal size before delta compression
delta_size: usizeDelta size (or full compressed size if not using delta)
is_delta: boolWhether this version uses delta encoding
similarity: f64Similarity score with base (0.0 - 1.0)
space_savings: f64Space savings percentage
Implementations§
Source§impl DeltaMetadata
impl DeltaMetadata
Sourcepub fn delta(
base_hash: String,
base_chain_depth: u32,
original_size: usize,
delta_size: usize,
similarity: f64,
) -> Self
pub fn delta( base_hash: String, base_chain_depth: u32, original_size: usize, delta_size: usize, similarity: f64, ) -> Self
Create metadata for a delta version
Sourcepub fn is_at_max_depth(&self) -> bool
pub fn is_at_max_depth(&self) -> bool
Check if this version is at max chain depth
Sourcepub fn compression_ratio(&self) -> f64
pub fn compression_ratio(&self) -> f64
Calculate compression ratio
Trait Implementations§
Source§impl Clone for DeltaMetadata
impl Clone for DeltaMetadata
Source§impl Debug for DeltaMetadata
impl Debug for DeltaMetadata
Source§impl<'de> Deserialize<'de> for DeltaMetadata
impl<'de> Deserialize<'de> for DeltaMetadata
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for DeltaMetadata
impl PartialEq for DeltaMetadata
Source§impl Serialize for DeltaMetadata
impl Serialize for DeltaMetadata
impl StructuralPartialEq for DeltaMetadata
Auto Trait Implementations§
impl Forget for DeltaMetadata
impl Freeze for DeltaMetadata
impl RefUnwindSafe for DeltaMetadata
impl Send for DeltaMetadata
impl Sync for DeltaMetadata
impl Unpin for DeltaMetadata
impl UnsafeUnpin for DeltaMetadata
impl UnwindSafe for DeltaMetadata
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