pub fn reconstruct(records: impl IntoIterator<Item = LogRecord>) -> WorldStateExpand description
Rebuild the world from records, in any arrival order, with duplicates.
Properties (tested in tests/event_sourcing.rs):
- R-1: any arrival order respecting nothing at all — reconstruct sorts per-token by seq — yields byte-identical serialized state;
- R-3: duplicates of
(token, seq, kind-discriminant)are dropped; - R-2: reconstruct(prefix) + replay(suffix) ≡ reconstruct(all) —
WorldStateis a snapshot, andapply_suffixis the replay.