pub struct Subscriber { /* private fields */ }Expand description
Receiver side: a Receiver plus the protocol state, enforcing the §2.3/§5.4 rules.
The baseline is established by either a single-shot apply of
the seq-0 snapshot batch or a sequence of apply_snapshot_chunk calls; then
incremental batches flow.
Implementations§
Source§impl Subscriber
impl Subscriber
Sourcepub fn open(hello: &Hello) -> Result<Subscriber, ProtocolError>
pub fn open(hello: &Hello) -> Result<Subscriber, ProtocolError>
Open from a Hello: hard-reject a comparator-contract mismatch (§5.5), verify
the advertised fingerprint matches the shipped schema, and build the receiver
from that schema. Apply the snapshot next (single-shot or chunked).
Sourcepub fn apply_snapshot_chunk(
&mut self,
chunk: &SnapshotChunk,
) -> Result<SnapStatus, ProtocolError>
pub fn apply_snapshot_chunk( &mut self, chunk: &SnapshotChunk, ) -> Result<SnapStatus, ProtocolError>
Apply one SnapshotChunk of a chunked hydrate snapshot. Validates epoch +
schema-fp + strict in-order chunk index, applies its adds, and on the last
chunk transitions to live (snapshot complete — the tree may render).
A re-delivered (or post-completion) chunk is a no-op SnapStatus::Duplicate;
a chunk-index gap is a fatal ProtocolError::Gap (re-hydrate).
Sourcepub fn apply(&mut self, batch: &Batch) -> Result<Applied, ProtocolError>
pub fn apply(&mut self, batch: &Batch) -> Result<Applied, ProtocolError>
Apply one incremental Batch (or the single-shot seq-0 snapshot batch).
Validates epoch + schema-fp + strict in-order seq, then folds the events in
order. A duplicate (already-applied seq) is a no-op Applied::Duplicate; a gap
is a fatal ProtocolError::Gap (re-hydrate).
Sourcepub fn top(&self) -> &[RecvNode]
pub fn top(&self) -> &[RecvNode]
The reconstructed top-level result (root[""]). Valid to read once the snapshot
is complete (snapshot_complete); mid-snapshot
it is a partial tree (render only after completion — §5.4).
Sourcepub fn snapshot_complete(&self) -> bool
pub fn snapshot_complete(&self) -> bool
Whether the hydrate snapshot is complete (the tree may render).