#[non_exhaustive]pub enum RuntimeState {
Initializing,
Idle,
Running,
Recovering,
Retired,
Stopped,
Destroyed,
}Expand description
The state of a runtime instance.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Initializing
Initializing (first state after creation).
Idle
Idle — no run in progress, ready to accept input.
Running
A run is in progress.
Recovering
Recovering from a crash or error.
Retired
Retired — no longer accepting new input, draining existing.
Stopped
Permanently stopped (terminal).
Destroyed
Destroyed (terminal).
Implementations§
Source§impl RuntimeState
impl RuntimeState
Sourcepub fn is_terminal(&self) -> bool
pub fn is_terminal(&self) -> bool
Check if this is a terminal state.
Sourcepub fn can_accept_input(&self) -> bool
pub fn can_accept_input(&self) -> bool
Check if the runtime can accept new input in this state.
Sourcepub fn can_process_queue(&self) -> bool
pub fn can_process_queue(&self) -> bool
Check if the runtime can process queued inputs in this state.
Retired runtimes can still drain their queue but cannot accept new input.
Sourcepub fn can_transition_to(&self, next: &RuntimeState) -> bool
pub fn can_transition_to(&self, next: &RuntimeState) -> bool
Validate a transition from this state to another (§22 table).
Sourcepub fn transition(
&mut self,
next: RuntimeState,
) -> Result<(), RuntimeStateTransitionError>
pub fn transition( &mut self, next: RuntimeState, ) -> Result<(), RuntimeStateTransitionError>
Attempt to transition, returning an error if invalid.
Trait Implementations§
Source§impl Clone for RuntimeState
impl Clone for RuntimeState
Source§fn clone(&self) -> RuntimeState
fn clone(&self) -> RuntimeState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RuntimeState
impl Debug for RuntimeState
Source§impl<'de> Deserialize<'de> for RuntimeState
impl<'de> Deserialize<'de> for RuntimeState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for RuntimeState
impl Display for RuntimeState
Source§impl Hash for RuntimeState
impl Hash for RuntimeState
Source§impl PartialEq for RuntimeState
impl PartialEq for RuntimeState
Source§impl Serialize for RuntimeState
impl Serialize for RuntimeState
impl Copy for RuntimeState
impl Eq for RuntimeState
impl StructuralPartialEq for RuntimeState
Auto Trait Implementations§
impl Freeze for RuntimeState
impl RefUnwindSafe for RuntimeState
impl Send for RuntimeState
impl Sync for RuntimeState
impl Unpin for RuntimeState
impl UnsafeUnpin for RuntimeState
impl UnwindSafe for RuntimeState
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.