pub enum RuntimeState {
Booting,
Running,
Stopping,
Emergency,
}Expand description
Runtime lifecycle state.
Represents the current operating mode of the scheduler runtime.
§State Transitions
┌─────────┐ ┌─────────┐ ┌──────────┐
│ Booting │────>│ Running │────>│ Stopping │
└─────────┘ └─────────┘ └──────────┘
│ │ │
└───────────────┴───────────────┘
│
v
┌───────────┐
│ Emergency │
└───────────┘Variants§
Booting
Initializing subsystems, loading modules.
Linux equivalent: TASK_NEW
Running
Normal operation, processing events.
Linux equivalent: TASK_RUNNING
Stopping
Graceful shutdown in progress.
Remaining work is drained before full stop.
Linux equivalent: TASK_STOPPED
Emergency
Emergency shutdown (panic recovery mode).
No new work accepted, cleanup only.
Linux equivalent: Kernel oops handling
Implementations§
Source§impl RuntimeState
impl RuntimeState
Sourcepub const fn is_running(&self) -> bool
pub const fn is_running(&self) -> bool
Check if runtime is in the running state.
Only in Running state can new work be accepted.
Sourcepub const fn is_shutting_down(&self) -> bool
pub const fn is_shutting_down(&self) -> bool
Check if shutdown is in progress.
Returns true for both Stopping and Emergency states.
Sourcepub const fn can_accept_work(&self) -> bool
pub const fn can_accept_work(&self) -> bool
Check if runtime can accept new work.
Equivalent to is_running() - only running runtime accepts work.
Sourcepub const fn is_terminal(&self) -> bool
pub const fn is_terminal(&self) -> bool
Check if this is a terminal state.
Terminal states indicate the runtime should stop its main loop.
Trait Implementations§
Source§impl Clone for RuntimeState
impl Clone for RuntimeState
Source§fn clone(&self) -> RuntimeState
fn clone(&self) -> RuntimeState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more