Expand description
Control behavior for the SIM runtime: async, backtracking, conditions.
The kernel defines the control-policy contracts; this crate supplies the concrete control organ (coroutines, generators, restarts, non-local exits) layered over those contracts.
Structs§
- Admission
Limit - Maximum jobs accepted by a queue collection.
- Async
Task - A deterministic async task that resolves after a fixed number of polls.
- Backtracker
- A linear backtracking choice point over a fixed list of alternatives.
- Checkpoint
Receipt - Receipt for a drain-to-empty checkpoint.
- Cleanup
Stack - Cleanup callbacks for nested dynamic extents.
- Close
Guard - A value paired with the callable that closes it at scope exit.
- Condition
- A signalled condition: a kind symbol plus a payload reference.
- Condition
Handler - A handler bound to a condition kind, prompt, and capture continuation.
- Condition
Stack - A stack of
ConditionHandlers, searched innermost-first on signal. - Continuation
Value - A runtime object wrapping a captured continuation and its capture result.
- Control
Function - A callable runtime object exposing one control primitive.
- Control
Lib - The control organ as a loadable kernel
Lib. - Control
Result Value - A runtime object wrapping the result reference of a control operation.
- Control
Tag - Stable tag identifying a delimited control prompt.
- Coroutine
- Two cooperating value streams that yield by alternating between lanes.
- Coroutine
Frame - A resumable producer/consumer frame for control libraries.
- Drain
Receipt - Receipt for a bounded drain.
- Frame
Limits - Limits applied to one resumable frame.
- Generator
- A single-lane generator that yields a fixed sequence of values on demand.
- IfForm
- The
ifspecial form:(if test then)or(if test then else). - JobId
- Stable identity assigned to an admitted job.
- JobQueues
- Deterministic, typed FIFO queues driven only by explicit caller operations.
- JobReceipt
- Receipt for admission or cancellation.
- Labeled
Prompt - A labeled escape target: a label symbol bound to a control prompt.
- NonLocal
Exit - A pending non-local exit: a kind, a target label, and a carried value.
- OneShot
Control Policy - A control policy that allows each captured continuation to resume once.
- Restart
- A named recovery point: a symbol bound to a captured continuation.
- Restart
Stack - A stack of
Restarts, searched innermost-first by name on invocation. - Resumable
Frame - A surface-neutral, one-shot-completion resumable frame.
- Segmented
Control Policy - A one-shot control policy scoped to a named delimited segment.
- Step
Budget - Budget passed to a frame driver for one resume operation.
- Work
Limit - Maximum jobs executed by one drain operation.
Enums§
- Async
Poll - Outcome of polling an
AsyncTask: pending work or a ready result. - Backtrack
Step - Result of advancing a
Backtracker: the next alternative, or failure. - Checkpoint
Error - Closed failures from bounded admission and checkpoint work.
- Coroutine
Frame Step - The next observable transition from a resumable coroutine frame.
- Coroutine
Lane - Identifies which of a coroutine’s two cooperating lanes yielded a value.
- Coroutine
Step - Outcome of resuming a
Coroutine: a yielded value, or exhaustion. - Frame
Error - Failure enforced by the frame boundary rather than by its guest driver.
- Generator
Step - Outcome of advancing a
Generator: a yielded value, or exhaustion. - JobStatus
- Recorded lifecycle state for a job.
- NonLocal
Exit Kind - The flavor of a non-local exit: loop break, loop continue, or block return.
- Protected
Outcome - Result of invoking a callable through a protected boundary.
- Resume
Packet - Input delivered when a frame is resumed.
- Resume
Result - Observable result of a resume operation.
- Runtime
JobClass - Runtime-owned queue classes which must never share a FIFO.
- Unwind
- A language-neutral reason for leaving a dynamic extent.
Statics§
- RECIPES
- Cookbook recipes for this lib, embedded at build time.
Traits§
- Control
Prompt - Library-level contract for prompts raised by runtime organs.
Functions§
- abort_
symbol - Returns the
control/abortsymbol. - capture_
symbol - Returns the
control/capturesymbol. - control_
exports - Returns the lib’s exported
control/*functions as kernelExports. - control_
op_ keys - Returns the standard control operation keys this organ claims:
prompt,capture,abort, andresume. - control_
organ_ symbol - Returns the
organ/controlsymbol identifying this control organ. - escape_
to_ label - Performs
exitby aborting to the matchingLabeledPromptinprompts. - install_
control_ lib - Installs the control organ into
cx: loadsControlLibidempotently, installs the default control policy, and publishes the organ’s claims. - install_
control_ policy - Installs the default
one_shot_control_policyintocxas the active control policy. - invoke_
restart - Invokes the restart named
nameonstackwithvalue; free-function form ofRestartStack::invoke. - manifest_
name - Returns the
sim/controlmanifest id under which this lib registers. - one_
shot_ control_ policy - Builds a shared
OneShotControlPolicyas a kernelControlPolicyRef. - physical_
sensing_ trace_ symbol - Returns the
control/physical-sensing-tracefixture symbol. - prompt_
symbol - Returns the
control/promptsymbol. - protected_
call - Calls
functionand maps kernel errors into a returned protected outcome. - publish_
control_ organ_ claims - Publishes the control organ’s claims into
cx, recording that this organ supplies the standardcontrol_op_keysundercontrol_organ_symbol. - publish_
control_ organ_ claims_ for_ lib - Publishes control organ claims as part of a loaded lib receipt.
- raise_
prompt - Raises a library-level control prompt through the kernel control contract.
- resume_
symbol - Returns the
control/resumesymbol. - run_
with_ close_ guards - Runs
bodyand closes all guards in reverse order before returning. - segmented_
control_ policy - Builds a shared
SegmentedControlPolicybound tosegmentas a kernelControlPolicyRef. - signal_
condition - Signals
conditionagainststack; free-function form ofConditionStack::signal.