pub struct IncrementalCheckpointChain {
pub base_snapshot_token: String,
pub incremental_tokens: Vec<String>,
pub total_delta_entries: u64,
pub is_complete: bool,
}Expand description
Incremental checkpoint chain information
Fields§
§base_snapshot_token: StringBase snapshot token (the full snapshot this chain starts from)
incremental_tokens: Vec<String>List of incremental checkpoint tokens in order
total_delta_entries: u64Total number of delta entries across all incremental checkpoints
is_complete: boolWhether the chain is complete (valid from base to latest)
Implementations§
Source§impl IncrementalCheckpointChain
impl IncrementalCheckpointChain
Sourcepub fn new(base_snapshot_token: CheckpointToken) -> Self
pub fn new(base_snapshot_token: CheckpointToken) -> Self
Create a new chain starting from a base snapshot
Sourcepub fn add_incremental(&mut self, token: CheckpointToken, num_entries: u64)
pub fn add_incremental(&mut self, token: CheckpointToken, num_entries: u64)
Add an incremental checkpoint to the chain
Sourcepub fn latest_token(&self) -> Result<CheckpointToken>
pub fn latest_token(&self) -> Result<CheckpointToken>
Get the latest token in the chain (or base if no incrementals)
Sourcepub fn num_incrementals(&self) -> usize
pub fn num_incrementals(&self) -> usize
Get number of incremental checkpoints in the chain
Sourcepub fn serialize_json(&self) -> Result<Vec<u8>>
pub fn serialize_json(&self) -> Result<Vec<u8>>
Serialize to JSON bytes
Sourcepub fn deserialize_json(data: &[u8]) -> Result<Self>
pub fn deserialize_json(data: &[u8]) -> Result<Self>
Deserialize from JSON bytes
Sourcepub fn write_to_file(&self, path: &Path) -> Result<()>
pub fn write_to_file(&self, path: &Path) -> Result<()>
Write to file (JSON format)
Sourcepub fn read_from_file(path: &Path) -> Result<Self>
pub fn read_from_file(path: &Path) -> Result<Self>
Read from file (JSON format)
Trait Implementations§
Source§impl Clone for IncrementalCheckpointChain
impl Clone for IncrementalCheckpointChain
Source§fn clone(&self) -> IncrementalCheckpointChain
fn clone(&self) -> IncrementalCheckpointChain
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 IncrementalCheckpointChain
impl Debug for IncrementalCheckpointChain
Source§impl<'de> Deserialize<'de> for IncrementalCheckpointChain
impl<'de> Deserialize<'de> for IncrementalCheckpointChain
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
Auto Trait Implementations§
impl Freeze for IncrementalCheckpointChain
impl RefUnwindSafe for IncrementalCheckpointChain
impl Send for IncrementalCheckpointChain
impl Sync for IncrementalCheckpointChain
impl Unpin for IncrementalCheckpointChain
impl UnwindSafe for IncrementalCheckpointChain
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