pub struct SnapshotDecoder(/* private fields */);Expand description
Decodes a snapshot without retaining its rows or write history. The caller
stages records and commits only after finish succeeds. Its oracle must
describe the causally closed applied writes recorded by this snapshot.
Populate that oracle from section 1. Loss records add no oracle metadata;
the consumer validates active losses against merge rows. Only the header, counts and
previous record identities are retained between frames. The database consumer
checks cross-section completeness, SQL schema rules and app-row visibility;
merge’s removal computation checks which removal rules actually hold.
Implementations§
Source§impl SnapshotDecoder
impl SnapshotDecoder
Sourcepub fn history_frame(
&mut self,
bytes: &[u8],
) -> Result<Option<SnapshotRecord>, Error>
pub fn history_frame( &mut self, bytes: &[u8], ) -> Result<Option<SnapshotRecord>, Error>
Extract original slots and claim settlement evidence before the store’s
historical signing keys are known. Other sections are counted and skipped;
this is not row validation. A loader must subsequently decode the entire
authenticated snapshot with frame before installing its data.
Sourcepub fn start(frame: &[u8], prefix: &SnapshotObjectPrefix) -> Result<Self, Error>
pub fn start(frame: &[u8], prefix: &SnapshotObjectPrefix) -> Result<Self, Error>
Read the initial header frame using coverage from the authenticated sealed prefix.
Sourcepub fn header(&self) -> &SnapshotHeader
pub fn header(&self) -> &SnapshotHeader
Identity, schema and coverage of this snapshot.
Sourcepub fn frame<O: WriteSlots>(
&mut self,
bytes: &[u8],
oracle: &O,
) -> Result<Option<SnapshotRecord>, O::Error>
pub fn frame<O: WriteSlots>( &mut self, bytes: &[u8], oracle: &O, ) -> Result<Option<SnapshotRecord>, O::Error>
Decode a record or end marker. Merge checks row invariants using the supplied oracle. Every error leaves counts and order unchanged.