pub struct IcSnapshotDataCoverage<'metadata> { /* private fields */ }Expand description
Ephemeral coverage of exact retained metadata by already decoded data replies.
Each region advances contiguously from zero; regions may be interleaved and chunk-store replies may arrive in any order. Retained state is three nat64 cursors and at most 1,024 chunk-presence bits, regardless of snapshot size. Admission retains no data bytes and performs no IO or provider calls. It does not establish authenticated origin, byte custody, durable storage, accounting or permission to repeat reads. Reconstructing this value starts empty; it is never a resume journal or a substitute for one.
Implementations§
Source§impl<'metadata> IcSnapshotDataCoverage<'metadata>
impl<'metadata> IcSnapshotDataCoverage<'metadata>
Sourcepub fn new(metadata: &'metadata IcSnapshotMetadataReply<'metadata>) -> Self
pub fn new(metadata: &'metadata IcSnapshotMetadataReply<'metadata>) -> Self
Start empty coverage under one exact original metadata evidence owner.
Sourcepub fn admit(
&mut self,
reply: &IcSnapshotDataReply<'_, '_>,
) -> Result<(), IcSnapshotDataCoverageError>
pub fn admit( &mut self, reply: &IcSnapshotDataReply<'_, '_>, ) -> Result<(), IcSnapshotDataCoverageError>
Admit one validated reply, advancing only its region or exact chunk bit.
Reply bytes may be dropped afterwards. That permits bounded streaming, but coverage alone therefore makes no retained-byte or transfer attestation. The order required within a region is a local admission order, not a grant of remote dispatch order or another accounted read.
§Errors
Rejects different metadata request/raw-reply evidence, gaps, overlaps, duplicate ranges or duplicate chunk identities. Every error preserves the previous coverage unchanged.
Sourcepub const fn metadata(&self) -> &'metadata IcSnapshotMetadataReply<'metadata>
pub const fn metadata(&self) -> &'metadata IcSnapshotMetadataReply<'metadata>
Read exact original metadata, including non-data globals and optional fields.
Sourcepub const fn covered_region_bytes(&self) -> [u64; 3]
pub const fn covered_region_bytes(&self) -> [u64; 3]
Read admitted module, heap and stable byte counts in that order.
Sourcepub fn covered_chunks(&self) -> usize
pub fn covered_chunks(&self) -> usize
Read the count of distinct admitted chunk-store replies, including empty chunks.
Sourcepub fn complete(&self) -> Option<IcSnapshotDataCoverageView<'_, 'metadata>>
pub fn complete(&self) -> Option<IcSnapshotDataCoverageView<'_, 'metadata>>
Project complete declared data coverage, without an effect or storage permit.
Every region must reach its exact declared size and every known chunk must have an admitted reply. Empty regions require no read; empty stored chunks still require their hash-checked reply. There is no combined-size sum that could overflow when independent regions use the full nat64 domain.