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§
- 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.
- 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.
- Generator
- A single-lane generator that yields a fixed sequence of values on demand.
- 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. - Segmented
Control Policy - A one-shot control policy scoped to a named delimited segment.
Enums§
- Async
Poll - Outcome of polling an
AsyncTask: not yet complete, or a ready result. - Backtrack
Step - Result of advancing a
Backtracker: the next alternative, or failure. - 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. - Generator
Step - Outcome of advancing a
Generator: a yielded value, or exhaustion. - NonLocal
Exit Kind - The flavor of a non-local exit: loop break, loop continue, or block return.
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. - prompt_
symbol - Returns the
control/promptsymbol. - 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. - segmented_
control_ policy - Builds a shared
SegmentedControlPolicybound tosegmentas a kernelControlPolicyRef. - signal_
condition - Signals
conditionagainststack; free-function form ofConditionStack::signal.