pub enum State<C: ?Sized + Config> {
Born,
Idle,
Busy,
Next(<C::Plan as Scheduler>::State),
Done(ExitStatus),
Gone(ExitStatus),
}Expand description
Represents the state of a Continuation throughout its lifecycle.
A Continuation starts in the Born state without references to
shared data or its future, as provided by its owning Job or Agent.
After binding pinned references to it, the Continuation moves to the
Idle state, indicating it is unscheduled.
From the Idle state, the Continuation can be scheduled by
inserting it into the event calendar at a specific model time,
transitioning it to the Next state. When the model time reaches this
point and the Continuation is activated, it enters the Busy state.
Upon completion, the Continuation transitions to the Done state,
indicating that a return value is available for extraction. At any point
before normal termination, the Continuation can be aborted, moving it
to the Gone state and dropping its bound future. The Gone state
is the final state in a Continuation’s lifecycle.
Variants§
Born
State of a continuation signifying a non-bound future and shared data.
Idle
State of a continuation that is waiting for external reactivation.
Busy
State of the continuation that is currently active. At most one continuation may be in this state during a simulation run at any time.
Next(<C::Plan as Scheduler>::State)
State of a continuation that is managed by the calendar.
Done(ExitStatus)
State of a completed continuation with a result available for extraction.
Gone(ExitStatus)
State of a continuation that cannot be scheduled anymore.
Implementations§
Source§impl<C: ?Sized + Config> State<C>
impl<C: ?Sized + Config> State<C>
Sourcepub const fn is_born(&self) -> bool
pub const fn is_born(&self) -> bool
Returns true if the current state is
Self::Born and false otherwise.
Sourcepub const fn is_idle(&self) -> bool
pub const fn is_idle(&self) -> bool
Returns true if the current state is
Self::Idle and false otherwise.
Sourcepub const fn is_busy(&self) -> bool
pub const fn is_busy(&self) -> bool
Returns true if the current state is
Self::Busy and false otherwise.
Sourcepub const fn is_next(&self) -> bool
pub const fn is_next(&self) -> bool
Returns true if the current state is
Self::Next and false otherwise.
Sourcepub const fn is_done(&self) -> bool
pub const fn is_done(&self) -> bool
Returns true if the current state is
Self::Done and false otherwise.
Sourcepub const fn is_gone(&self) -> bool
pub const fn is_gone(&self) -> bool
Returns true if the current state is
Self::Gone and false otherwise.
Sourcepub const fn is_init(&self) -> bool
pub const fn is_init(&self) -> bool
Returns true if the current state is
Self::Idle or Self::Busy or Self::Next or Self::Done or Self::Gone and false otherwise.
Sourcepub const fn is_term(&self) -> bool
pub const fn is_term(&self) -> bool
Returns true if the current state is
Self::Done or Self::Gone and false otherwise.