Skip to main content

Crate sim_lib_control

Crate sim_lib_control 

Source
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§

AsyncTask
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.
ConditionHandler
A handler bound to a condition kind, prompt, and capture continuation.
ConditionStack
A stack of ConditionHandlers, searched innermost-first on signal.
ContinuationValue
A runtime object wrapping a captured continuation and its capture result.
ControlFunction
A callable runtime object exposing one control primitive.
ControlLib
The control organ as a loadable kernel Lib.
ControlResultValue
A runtime object wrapping the result reference of a control operation.
ControlTag
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.
LabeledPrompt
A labeled escape target: a label symbol bound to a control prompt.
NonLocalExit
A pending non-local exit: a kind, a target label, and a carried value.
OneShotControlPolicy
A control policy that allows each captured continuation to resume once.
Restart
A named recovery point: a symbol bound to a captured continuation.
RestartStack
A stack of Restarts, searched innermost-first by name on invocation.
SegmentedControlPolicy
A one-shot control policy scoped to a named delimited segment.

Enums§

AsyncPoll
Outcome of polling an AsyncTask: not yet complete, or a ready result.
BacktrackStep
Result of advancing a Backtracker: the next alternative, or failure.
CoroutineLane
Identifies which of a coroutine’s two cooperating lanes yielded a value.
CoroutineStep
Outcome of resuming a Coroutine: a yielded value, or exhaustion.
GeneratorStep
Outcome of advancing a Generator: a yielded value, or exhaustion.
NonLocalExitKind
The flavor of a non-local exit: loop break, loop continue, or block return.

Traits§

ControlPrompt
Library-level contract for prompts raised by runtime organs.

Functions§

abort_symbol
Returns the control/abort symbol.
capture_symbol
Returns the control/capture symbol.
control_exports
Returns the lib’s exported control/* functions as kernel Exports.
control_op_keys
Returns the standard control operation keys this organ claims: prompt, capture, abort, and resume.
control_organ_symbol
Returns the organ/control symbol identifying this control organ.
escape_to_label
Performs exit by aborting to the matching LabeledPrompt in prompts.
install_control_lib
Installs the control organ into cx: loads ControlLib idempotently, installs the default control policy, and publishes the organ’s claims.
install_control_policy
Installs the default one_shot_control_policy into cx as the active control policy.
invoke_restart
Invokes the restart named name on stack with value; free-function form of RestartStack::invoke.
manifest_name
Returns the sim/control manifest id under which this lib registers.
one_shot_control_policy
Builds a shared OneShotControlPolicy as a kernel ControlPolicyRef.
prompt_symbol
Returns the control/prompt symbol.
publish_control_organ_claims
Publishes the control organ’s claims into cx, recording that this organ supplies the standard control_op_keys under control_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/resume symbol.
segmented_control_policy
Builds a shared SegmentedControlPolicy bound to segment as a kernel ControlPolicyRef.
signal_condition
Signals condition against stack; free-function form of ConditionStack::signal.