[−][src]Enum lucet_runtime_internals::instance::state::State
The representation of a Lucet instance's state machine.
Variants
The instance is ready to run.
Transitions to Running
when the instance is run, or to Ready
when it's reset.
The instance is running.
Transitions to Ready
when the guest function returns normally, or to Faulted
,
Terminating
, or Yielding
if the instance faults, terminates, or yields.
The instance has faulted, potentially fatally.
Transitions to Faulted
when filling in additional fault details, to Running
if
re-running a non-fatally faulted instance, or to Ready
when the instance is reset.
Fields of Faulted
The instance is in the process of terminating.
Transitions only to Terminated
; the TerminationDetails
are always extracted into a
RunResult
before anything else happens to the instance.
Fields of Terminating
details: TerminationDetails
The instance has terminated, and must be reset before running again.
Transitions to Ready
if the instance is reset.
The instance is in the process of yielding.
Transitions only to Yielded
; the YieldedVal
is always extracted into a
RunResult
before anything else happens to the instance.
Fields of Yielding
val: YieldedVal
expecting: Box<dyn Any>
A phantom value carrying the type of the expected resumption value.
Concretely, this should only ever be Box<PhantomData<R>>
where R
is the type
the guest expects upon resumption.
The instance has yielded.
Transitions to Running
if the instance is resumed, or to Ready
if the instance is reset.
Fields of Yielded
A placeholder state used with std::mem::replace()
when a new state must be constructed by
moving values out of an old state.
This is used so that we do not need a Clone
impl for this type, which would add
unnecessary constraints to the types of values instances could yield or terminate with.
It is an error for this state to appear outside of a transition between other states.
Methods
impl State
[src]
pub fn is_ready(&self) -> bool
[src]
pub fn is_running(&self) -> bool
[src]
pub fn is_fault(&self) -> bool
[src]
pub fn is_fatal(&self) -> bool
[src]
pub fn is_terminated(&self) -> bool
[src]
pub fn is_yielded(&self) -> bool
[src]
Trait Implementations
Auto Trait Implementations
impl !Send for State
impl !Sync for State
impl Unpin for State
impl !UnwindSafe for State
impl !RefUnwindSafe for State
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self