pub struct TimelineForker<S: KernelState> {
pub events: Box<dyn EventStore>,
pub reducer: Box<dyn Reducer<S>>,
}Expand description
Timeline forker: creates alternate execution timelines from checkpoints.
Fields§
§events: Box<dyn EventStore>Event store (source of truth).
reducer: Box<dyn Reducer<S>>Reducer to apply events to state.
Implementations§
Source§impl<S: KernelState> TimelineForker<S>
impl<S: KernelState> TimelineForker<S>
Sourcepub fn fork(
&self,
source_run_id: &RunId,
branch_id: RunId,
fork_at_seq: Seq,
alternate_event: Event,
initial_state: S,
) -> Result<ForkResult<S>, KernelError>
pub fn fork( &self, source_run_id: &RunId, branch_id: RunId, fork_at_seq: Seq, alternate_event: Event, initial_state: S, ) -> Result<ForkResult<S>, KernelError>
Forks the timeline at checkpoint fork_at_seq.
- Replays source run up to
fork_at_seq. - Injects
alternate_eventat the fork point. - Continues replaying remaining events under new
branch_id. - Returns the fork metadata and final state.
Sourcepub fn clone_timeline(
&self,
source_run_id: &RunId,
branch_id: RunId,
initial_state: S,
) -> Result<ForkResult<S>, KernelError>
pub fn clone_timeline( &self, source_run_id: &RunId, branch_id: RunId, initial_state: S, ) -> Result<ForkResult<S>, KernelError>
Creates a fork that starts fresh (no alternate event) - useful for simulation/audit. This replays the entire run under a new branch_id.
Auto Trait Implementations§
impl<S> Freeze for TimelineForker<S>
impl<S> !RefUnwindSafe for TimelineForker<S>
impl<S> Send for TimelineForker<S>
impl<S> Sync for TimelineForker<S>
impl<S> Unpin for TimelineForker<S>
impl<S> UnsafeUnpin for TimelineForker<S>
impl<S> !UnwindSafe for TimelineForker<S>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more