pub struct NormalizedSubscriber { /* private fields */ }Expand description
Receiver side: the protocol state machine that validates the envelope and emits
clean ops for the caller (the base-store fold / TS NormalizedSync) to apply. It does
not itself hold the base store — it owns only epoch/seq/fp state.
Implementations§
Source§impl NormalizedSubscriber
impl NormalizedSubscriber
Sourcepub fn open(
hello: &NormalizedHello,
) -> Result<NormalizedSubscriber, NormalizedProtocolError>
pub fn open( hello: &NormalizedHello, ) -> Result<NormalizedSubscriber, NormalizedProtocolError>
Open from a NormalizedHello: validate the wire-constructed table set before
fingerprinting it, hard-reject a comparator-contract mismatch (§5.5), and verify
the advertised fingerprint matches the shipped table set. Apply the seq-0 snapshot
batch next.
Sourcepub fn apply(
&mut self,
batch: &NormalizedBatch,
) -> Result<NormalizedApplied, NormalizedProtocolError>
pub fn apply( &mut self, batch: &NormalizedBatch, ) -> Result<NormalizedApplied, NormalizedProtocolError>
Apply one batch (the seq-0 snapshot or an incremental batch). Validates epoch +
fingerprint + strict in-order seq, returning the ops to apply on success. A
duplicate (already-applied seq) is NormalizedApplied::Duplicate (no ops); a gap
is a fatal NormalizedProtocolError::Gap (re-hydrate under a new epoch).