pub struct ExecutorContext<E, M: Model<E>> { /* private fields */ }Expand description
Manages the simulation state at the execution engine level.
This structure is used by the runner to control the simulation’s progression. Unlike the user-facing context, this provides a low-level interface for controlling internal simulation steps and hook processing.
Implementations§
Source§impl<E, M: Model<E>> ExecutorContext<E, M>
impl<E, M: Model<E>> ExecutorContext<E, M>
Sourcepub fn peek_next_tick(&self) -> (ExecutorStatus, TickStatus)
pub fn peek_next_tick(&self) -> (ExecutorStatus, TickStatus)
Previews the status of the next tick.
§Returns
An ExecutorStatus indicating if events exist, and the next tick information.
Sourcepub fn begin_tick(self, model: &M) -> ActiveExecutorContext<E, M>
pub fn begin_tick(self, model: &M) -> ActiveExecutorContext<E, M>
Initiates processing for the current tick and transitions to an active context.
Invokes the before_tick hook and updates the simulation state.
Sourcepub fn end_simulation_as_ok<Err>(self, model: M) -> SimulationResult<M, Err>
pub fn end_simulation_as_ok<Err>(self, model: M) -> SimulationResult<M, Err>
Terminates the simulation successfully and returns the result.
Sourcepub fn end_simulation_as_error<Err>(
self,
model: M,
error: Err,
) -> SimulationResult<M, Err>
pub fn end_simulation_as_error<Err>( self, model: M, error: Err, ) -> SimulationResult<M, Err>
Terminates the simulation with an error and returns the result.
Auto Trait Implementations§
impl<E, M> Freeze for ExecutorContext<E, M>
impl<E, M> !RefUnwindSafe for ExecutorContext<E, M>
impl<E, M> !Send for ExecutorContext<E, M>
impl<E, M> !Sync for ExecutorContext<E, M>
impl<E, M> Unpin for ExecutorContext<E, M>where
E: Unpin,
impl<E, M> UnsafeUnpin for ExecutorContext<E, M>
impl<E, M> !UnwindSafe for ExecutorContext<E, M>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more