pub struct SourceContext<E, M: Model<E>> { /* private fields */ }Expand description
Context information provided during the source execution phase.
This context provides access to the current simulation time and micro-step status during model execution, as well as functionality for scheduling events.
Trait Implementations§
Source§impl<E, M: Model<E>> UserContext<E, M> for SourceContext<E, M>
impl<E, M: Model<E>> UserContext<E, M> for SourceContext<E, M>
Source§fn current_tick(&self) -> SimTime
fn current_tick(&self) -> SimTime
Returns the current simulation tick (absolute time).
Source§fn current_micro_step(&self) -> MicroStep
fn current_micro_step(&self) -> MicroStep
Returns the current micro-step (the index of the step within the current tick).
Source§fn schedule_event(
&mut self,
delay: Duration,
priority: EventPriority,
event_payload: E,
)
fn schedule_event( &mut self, delay: Duration, priority: EventPriority, event_payload: E, )
Schedules an event with the specified delay and priority. Read more
Auto Trait Implementations§
impl<E, M> Freeze for SourceContext<E, M>
impl<E, M> !RefUnwindSafe for SourceContext<E, M>
impl<E, M> !Send for SourceContext<E, M>
impl<E, M> !Sync for SourceContext<E, M>
impl<E, M> Unpin for SourceContext<E, M>where
E: Unpin,
impl<E, M> UnsafeUnpin for SourceContext<E, M>
impl<E, M> !UnwindSafe for SourceContext<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