pub struct SnapshotChunkDecoder { /* private fields */ }Expand description
Incrementally reconstruct frames and check the snapshot’s end marker.
Call Self::next_record repeatedly on each opened chunk, updating the
oracle after each applied-write record before asking for the next record.
Implementations§
Source§impl SnapshotChunkDecoder
impl SnapshotChunkDecoder
Sourcepub fn new(prefix: SnapshotObjectPrefix) -> Self
pub fn new(prefix: SnapshotObjectPrefix) -> Self
Supply the authenticated prefix, including the snapshot’s coverage.
Sourcepub fn header(&self) -> Option<&SnapshotHeader>
pub fn header(&self) -> Option<&SnapshotHeader>
Header metadata becomes available as soon as its frame is complete.
Sourcepub fn next_record<O: WriteSlots>(
&mut self,
bytes: &mut &[u8],
oracle: &O,
) -> Result<Option<SnapshotRecord>, O::Error>
pub fn next_record<O: WriteSlots>( &mut self, bytes: &mut &[u8], oracle: &O, ) -> Result<Option<SnapshotRecord>, O::Error>
Consume bytes through the next complete record, or all available bytes
if its frame is unfinished. None means this input has no further record.
Discard the decoder after an error; commit staged rows only after finish.
Sourcepub fn next_history(
&mut self,
bytes: &mut &[u8],
) -> Result<Option<SnapshotRecord>, Error>
pub fn next_history( &mut self, bytes: &mut &[u8], ) -> Result<Option<SnapshotRecord>, Error>
Like Self::next_record, before the store’s historical signing keys
are known: only original slots and last claims are decoded, and every
other record is counted and passed over (SnapshotDecoder::history_frame).
A loader still decodes every record with Self::next_record.
Sourcepub fn frame(&self) -> &[u8] ⓘ
pub fn frame(&self) -> &[u8] ⓘ
The exact bytes of the frame the last returned record came from, for a
loader that stages the record and reads it back with
SnapshotRecord::decode_checked.