pub struct SuspensionState {
pub waiting_for: WaitCondition,
pub resume_pc: usize,
pub saved_locals: Vec<KindedSlot>,
pub saved_stack: Vec<KindedSlot>,
}Expand description
Suspension state for resumable execution
When a Shape program yields or awaits, this state captures everything needed to resume execution later.
WB2.5 retain-on-read. saved_locals / saved_stack hold
owning shares of heap-tagged values. ADR-006 §2.7 GENERIC_CARRIER
vector storage: Vec<KindedSlot> carries the explicit Drop/Clone
discipline so push/pop/clone preserve refcount semantics. The serde
skip-on-payload pattern matches the snapshot.rs:650 comment — slot
(de)serialization is deferred to the kind-threaded follow-up API.
Fields§
§waiting_for: WaitConditionWhat condition we’re waiting for
resume_pc: usizeProgram counter to resume at (for VM/JIT)
saved_locals: Vec<KindedSlot>Saved local variables
saved_stack: Vec<KindedSlot>Saved stack (for VM)
Implementations§
Source§impl SuspensionState
impl SuspensionState
Sourcepub fn new(waiting_for: WaitCondition, resume_pc: usize) -> Self
pub fn new(waiting_for: WaitCondition, resume_pc: usize) -> Self
Create a new suspension state
Sourcepub fn with_locals(self, locals: Vec<KindedSlot>) -> Self
pub fn with_locals(self, locals: Vec<KindedSlot>) -> Self
Create with saved locals. KindedSlot::Drop retires refcounts on
drop; KindedSlot::Clone retains them on copy.
Sourcepub fn with_stack(self, stack: Vec<KindedSlot>) -> Self
pub fn with_stack(self, stack: Vec<KindedSlot>) -> Self
Create with saved stack
Trait Implementations§
Source§impl Clone for SuspensionState
impl Clone for SuspensionState
Source§fn clone(&self) -> SuspensionState
fn clone(&self) -> SuspensionState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more