Skip to main content

TimelineForker

Struct TimelineForker 

Source
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>

Source

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.

  1. Replays source run up to fork_at_seq.
  2. Injects alternate_event at the fork point.
  3. Continues replaying remaining events under new branch_id.
  4. Returns the fork metadata and final state.
Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.