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,
}Expand description
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.
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
details: TerminationDetailsTerminated
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
val: YieldedValYielded
The instance has yielded.
Transitions to Running if the instance is resumed, or to Ready if the instance is reset.
Fields
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.