pub enum KernelOp {
RouteOne {
dst: ActorId,
},
WorkflowTick {
wid: WorkflowId,
},
TimeTick,
UnblockSend {
dst: ActorId,
},
ThreadSwitch {
from: ThreadId,
to: ThreadId,
},
}Expand description
Kernel-internal operations (no external trigger)
Corresponds to Lean: inductive KernelOp
Variants§
RouteOne
Deliver one message to actor
Corresponds to Lean: | route_one (dst : ActorId)
WorkflowTick
Advance workflow
Corresponds to Lean: | workflow_tick (w : WorkflowId)
Fields
wid: WorkflowIdWorkflow to advance
TimeTick
Increment global time
Corresponds to Lean: | time_tick
UnblockSend
Unblock actor waiting to send
Corresponds to Lean: | unblock_send (dst : ActorId)
ThreadSwitch
Context switch between threads
Corresponds to Lean: | thread_switch (from_ to_ : ThreadId)
Implementations§
Source§impl KernelOp
impl KernelOp
Sourcepub fn execute(&self, state: &State) -> Result<State, StepError>
pub fn execute(&self, state: &State) -> Result<State, StepError>
Execute the kernel operation
Corresponds to Lean: def KernelExecInternal
Each operation modifies only its designated state component:
- route_one: moves message from pending to mailbox
- time_tick: increments global time
- workflow_tick: advances workflow state
- unblock_send: clears blockedOn for actor
§Errors
Returns StepError::ActorNotFound if the destination actor does not exist (RouteOne, UnblockSend).
Returns StepError::KernelOpFailed if the actor has no pending messages or its mailbox is full (RouteOne).
Returns StepError::KernelOpFailed if the workflow is not found or is not running (WorkflowTick).