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.
§Raising guest values
Every guest raises the non-recursive Raised envelope. The guest obtains
the envelope’s class identity from its declared class descriptor, retains
the ordinary guest value as the payload, and stores cause, context, group,
or suppression relationships as stable edges in ManagedException.
Handlers select that class through match_raised_class; neither a guest
language nor a host adapter needs another throwable record or relation
chain.
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.
- Class
Match Budget - Finite work allowance passed unchanged to the class-relation provider.
- Class
Match Evidence - Inspectable proof retained from a bounded subclass query.
- 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.
- Exception
Graph Budget - Maximum number of relation edges admitted to one graph projection.
- Exception
Graph Edge - One caller-typed relation in a bounded graph view.
- Exception
Graph View - Terminating graph projection with explicit loss reporting.
- 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.
- Managed
Exception - A guest exception payload with caller-defined relation roles.
- 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.
- Raised
- The one language-neutral exceptional-completion envelope.
- Raised
Browse Budget - Explicit byte budget for rendering a raised payload into a browse face.
- Raised
Browse Projection - Result of a bounded raised-envelope browse projection.
- Raised
Shape - Shape for the non-recursive
Raisedobject and its read-construct face. - 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. - Bounded
Subclass Outcome - Exact result supplied by a bounded class-relation provider such as CLASS_2.
- Checkpoint
Error - Closed failures from bounded admission and checkpoint work.
- Class
Match Outcome - Exact outcome of bounded handler class selection.
- 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.
Constants§
- RAISED_
SYMBOL - Stable read-construct identity for a raised completion envelope.
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. - match_
raised_ class - Matches a raised class using bounded subclass evidence and explicit policy.
- 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. - protected_
call_ with - Calls
functionwhile allowing a typed raised payload at the boundary. - 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.
Type Aliases§
- Raised
Condition - Condition payload specialized to the shared raised envelope.
- Raised
Protected Outcome - Protected-call result specialized to the shared raised envelope.
- Raised
Resume Packet - Resume input specialized to throwing the shared raised envelope.
- Raised
Resume Result - Resume result specialized to failure with the shared raised envelope.
- Raised
Unwind - Exceptional unwind specialized to the shared raised envelope.