[][src]Enum lucet_runtime_internals::instance::state::State

pub enum State {
    Ready,
    Running,
    Faulted {
        details: FaultDetails,
        siginfo: siginfo_t,
        context: UContext,
    },
    Terminating {
        details: TerminationDetails,
    },
    Terminated,
    Yielding {
        val: YieldedVal,
        expecting: Box<dyn Any>,
    },
    Yielded {
        expecting: Box<dyn Any>,
    },
    Transitioning,
}

The representation of a Lucet instance's state machine.

Variants

Ready

The instance is ready to run.

Transitions to Running when the instance is run, or to Ready when it's reset.

Running

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.

Faulted

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

details: FaultDetailssiginfo: siginfo_tcontext: UContext
Terminating

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
Terminated

The instance has terminated, and must be reset before running again.

Transitions to Ready if the instance is reset.

Yielding

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: YieldedValexpecting: 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.

Yielded

The instance has yielded.

Transitions to Running if the instance is resumed, or to Ready if the instance is reset.

Fields of Yielded

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.

Transitioning

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

impl Display for State[src]

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]

impl<T> From<T> for T[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self