Skip to main content

reduce

Function reduce 

Source
pub fn reduce(events: &[JournalEvent]) -> RunState
Expand description

Fold an ordered event stream into the materialized RunState — the pure, I/O-free core of the journal.

Deterministic and total: the same events (in seq order) always produce the same state. Events are applied in ascending seq regardless of slice order, so a defensively re-sorted log reduces identically.