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§

AdmissionLimit
Maximum jobs accepted by a queue collection.
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.
CheckpointReceipt
Receipt for a drain-to-empty checkpoint.
CleanupStack
Cleanup callbacks for nested dynamic extents.
CloseGuard
A value paired with the callable that closes it at scope exit.
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.
CoroutineFrame
A resumable producer/consumer frame for control libraries.
DrainReceipt
Receipt for a bounded drain.
FrameLimits
Limits applied to one resumable frame.
Generator
A single-lane generator that yields a fixed sequence of values on demand.
IfForm
The if special 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.
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.
ResumableFrame
A surface-neutral, one-shot-completion resumable frame.
SegmentedControlPolicy
A one-shot control policy scoped to a named delimited segment.
StepBudget
Budget passed to a frame driver for one resume operation.
WorkLimit
Maximum jobs executed by one drain operation.

Enums§

AsyncPoll
Outcome of polling an AsyncTask: pending work or a ready result.
BacktrackStep
Result of advancing a Backtracker: the next alternative, or failure.
CheckpointError
Closed failures from bounded admission and checkpoint work.
CoroutineFrameStep
The next observable transition from a resumable coroutine frame.
CoroutineLane
Identifies which of a coroutine’s two cooperating lanes yielded a value.
CoroutineStep
Outcome of resuming a Coroutine: a yielded value, or exhaustion.
FrameError
Failure enforced by the frame boundary rather than by its guest driver.
GeneratorStep
Outcome of advancing a Generator: a yielded value, or exhaustion.
JobStatus
Recorded lifecycle state for a job.
NonLocalExitKind
The flavor of a non-local exit: loop break, loop continue, or block return.
ProtectedOutcome
Result of invoking a callable through a protected boundary.
ResumePacket
Input delivered when a frame is resumed.
ResumeResult
Observable result of a resume operation.
RuntimeJobClass
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§

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.
physical_sensing_trace_symbol
Returns the control/physical-sensing-trace fixture symbol.
prompt_symbol
Returns the control/prompt symbol.
protected_call
Calls function and 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 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.
run_with_close_guards
Runs body and closes all guards in reverse order before returning.
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.