pub struct SnapshotComplete {
pub root_hash: [u8; 32],
pub total_entities: usize,
pub total_pages: usize,
pub uncompressed_size: u64,
pub compressed_size: Option<u64>,
pub dag_heads: Vec<[u8; 32]>,
}Expand description
Completion marker for snapshot transfer.
Sent after all pages have been transferred. Contains verification information for Invariant I7.
Fields§
§root_hash: [u8; 32]Root hash of the complete snapshot. INVARIANT I7: MUST be verified before applying any entities.
total_entities: usizeTotal number of entities transferred.
total_pages: usizeTotal number of pages transferred.
uncompressed_size: u64Uncompressed size in bytes.
compressed_size: Option<u64>Compressed size in bytes (if compression was used).
dag_heads: Vec<[u8; 32]>DAG heads at the time of snapshot. Used to create checkpoint delta after apply.
Implementations§
Source§impl SnapshotComplete
impl SnapshotComplete
Sourcepub fn new(
root_hash: [u8; 32],
total_entities: usize,
total_pages: usize,
uncompressed_size: u64,
) -> Self
pub fn new( root_hash: [u8; 32], total_entities: usize, total_pages: usize, uncompressed_size: u64, ) -> Self
Create a new snapshot completion marker.
Sourcepub fn with_compressed_size(self, size: u64) -> Self
pub fn with_compressed_size(self, size: u64) -> Self
Set compressed size.
Sourcepub fn with_dag_heads(self, heads: Vec<[u8; 32]>) -> Self
pub fn with_dag_heads(self, heads: Vec<[u8; 32]>) -> Self
Set DAG heads.
Sourcepub fn compression_ratio(&self) -> Option<f64>
pub fn compression_ratio(&self) -> Option<f64>
Calculate compression ratio (if compression was used).
Trait Implementations§
Source§impl BorshDeserialize for SnapshotComplete
impl BorshDeserialize for SnapshotComplete
fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl BorshSerialize for SnapshotComplete
impl BorshSerialize for SnapshotComplete
Source§impl Clone for SnapshotComplete
impl Clone for SnapshotComplete
Source§fn clone(&self) -> SnapshotComplete
fn clone(&self) -> SnapshotComplete
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 SnapshotComplete
impl Debug for SnapshotComplete
Source§impl PartialEq for SnapshotComplete
impl PartialEq for SnapshotComplete
impl StructuralPartialEq for SnapshotComplete
Auto Trait Implementations§
impl Freeze for SnapshotComplete
impl RefUnwindSafe for SnapshotComplete
impl Send for SnapshotComplete
impl Sync for SnapshotComplete
impl Unpin for SnapshotComplete
impl UnsafeUnpin for SnapshotComplete
impl UnwindSafe for SnapshotComplete
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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