Expand description
guard — Portability Guard (assert_portable).
DSL-agnostic IR portability invariant: a portable IR must not contain
non-serializable values. In Rust the runtime works over serde_json::Value
(already JSON-serializable) plus the native crate::value::Value, so the
only structurally non-portable case is a non-finite float (NaN/±Inf) which
cannot be represented in JSON. assert_portable walks a value and rejects it.
Structs§
Constants§
- PORTABLE_
COMPOUND_ KINDS - The compound type constructors of the portable type notation (same closed set as the TS guard’s
PORTABLE_COMPOUND_KINDS). - PORTABLE_
EXPR_ OPERATORS - The closed set of Expression-IR operators allowed in a portable IR (expression-ir.md §3).
- PORTABLE_
SCALAR_ TYPES - The closed set of scalar types in the portable type notation
(scp-ir-architecture.md §5.2, bc#44 B0). Compound types are the single-key
objects
{opt|arr|map|obj: ...}. - PORTABLE_
VALUE_ TYPE - The generic opaque-value literal (bc#156): the declared type of a driver boundary’s generic bound
value (
WireValue). Not a concrete scalar, but in the type notation it appears as the leaf string"value"({arr:"value"}= a list of bound values), accepted with the same strength as a scalar (it is a DECLARED opaque type, not an"any"escape hatch). Same as the TS guard’sPORTABLE_VALUE_TYPE.
Functions§
- assert_
portable - Assert that a runtime
Valueis portable (JSON-serializable). The only non-portable scalar in the Rust value model is a non-finite float. - assert_
portable_ component_ graph - Portability Guard for a component-graph IR (scp-ir-architecture.md §5), operating
on the raw
serde_json::ValueIR (P0-2). Enforces, fail-closed: - portable_
type_ has_ value - Does the portable type carry the opaque wire value
"value"ANYWHERE (recursive)? The COUNTERPART ofwire_passthrough_out_type_ok: an output type that containsvaluewithout being the legal passthrough shape (nested in a record field / map value / nested array) has no de-box contract. Same rule as the TSportableTypeHasValue(behavior.ts). - wire_
passthrough_ out_ type_ ok - Is an output-passthrough node’s
outTypethe legal opaque shape (value/{arr:"value"})? Passthrough only covers “the whole output” and “the DIRECT element of an output array” — avalueanywhere else has no de-box contract. Same rule as the TSwirePassthroughOutTypeOk(behavior.ts).