pub struct RunCycle { /* private fields */ }Expand description
⬡ Manages run phases and guards phase transitions.
RunCycle tracks the high-level lifecycle of a running system.
It is intentionally small:
- it does not advance time,
- it does not schedule work,
- it does not own runtime services.
It only answers what phase the run is in and whether a transition is valid.
Implementations§
Source§impl RunCycle
impl RunCycle
Sourcepub const fn is_running(self) -> bool
pub const fn is_running(self) -> bool
Returns true if the run is in the Running phase.
Sourcepub const fn is_stopped(self) -> bool
pub const fn is_stopped(self) -> bool
Returns true if the run is in the Stopped phase.
Sourcepub const fn can_advance(self) -> bool
pub const fn can_advance(self) -> bool
Returns true if logical progression is currently allowed.
Sourcepub const fn can_transition(self, next: RunPhase) -> bool
pub const fn can_transition(self, next: RunPhase) -> bool
Returns whether a transition from the current phase to next is valid.
Sourcepub const fn transition(&mut self, next: RunPhase) -> bool
pub const fn transition(&mut self, next: RunPhase) -> bool
Transitions to next if valid.
Returns true if the transition is valid.
Trait Implementations§
impl Copy for RunCycle
impl Eq for RunCycle
impl StructuralPartialEq for RunCycle
Auto Trait Implementations§
impl Freeze for RunCycle
impl RefUnwindSafe for RunCycle
impl Send for RunCycle
impl Sync for RunCycle
impl Unpin for RunCycle
impl UnsafeUnpin for RunCycle
impl UnwindSafe for RunCycle
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> ByteSized for T
impl<T> ByteSized for T
Source§const BYTE_ALIGN: usize = _
const BYTE_ALIGN: usize = _
The alignment of this type in bytes.
Source§fn byte_align(&self) -> usize
fn byte_align(&self) -> usize
Returns the alignment of this type in bytes.