pub struct ReplayEngine { /* private fields */ }Implementations§
Source§impl ReplayEngine
impl ReplayEngine
Sourcepub fn new(source: &str, target: &str, from_tick: u64, to_tick: u64) -> Self
pub fn new(source: &str, target: &str, from_tick: u64, to_tick: u64) -> Self
Create a replay engine for the given source/target and tick range.
Sourcepub fn source_timeline(&self) -> &str
pub fn source_timeline(&self) -> &str
Return a reference to the source timeline ID.
Sourcepub fn target_timeline(&self) -> &str
pub fn target_timeline(&self) -> &str
Return a reference to the target timeline ID.
Sourcepub fn events(&self) -> &[CanonEventSnapshot]
pub fn events(&self) -> &[CanonEventSnapshot]
Return a reference to all loaded events.
Sourcepub fn add_event(
&mut self,
event: CanonEventSnapshot,
) -> Result<(), ChronoshiftError>
pub fn add_event( &mut self, event: CanonEventSnapshot, ) -> Result<(), ChronoshiftError>
Append an event to the replay buffer.
Returns Err(ReplayOverflow) if the buffer has reached MAX_REPLAY_EVENTS.
Sourcepub fn validate_chain(&self) -> Result<(), ChronoshiftError>
pub fn validate_chain(&self) -> Result<(), ChronoshiftError>
Validate the digest chain of all loaded events.
For each event after the first, recompute the expected digest from the event fields and compare it to the stored digest. The first event’s digest is trusted as the chain root.
Returns Ok(()) if the chain is intact, or Err at the first
broken link.
Sourcepub fn replay_tick(&self, tick: u64) -> Vec<CanonEventSnapshot>
pub fn replay_tick(&self, tick: u64) -> Vec<CanonEventSnapshot>
Get all events for a specific tick, in sequence order.
Sourcepub fn replay_range(&self, from: u64, to: u64) -> Vec<CanonEventSnapshot>
pub fn replay_range(&self, from: u64, to: u64) -> Vec<CanonEventSnapshot>
Get all events in a tick range [from, to] inclusive, in order.
Sourcepub fn compute_determinism_hash(&self) -> String
pub fn compute_determinism_hash(&self) -> String
Compute a BLAKE3 hash over all replayed events for determinism comparison. The hash covers event_id, event_type, tick, seq, and digest of every event in canonical order.