Expand description
The public arena schema IR: a flat, immutable, hash-consed DAG built once through Builder
and consumed directly by the compiler. All fields are private; the only ways in are
Builder::finish and SchemaIR::from_wire, and the only way out is a read-only accessor.
Structs§
- Anchor
Id - Dense frozen anchor-record identifier.
- Anchor
Record - Frozen static or dynamic anchor declaration.
- Anchor
Slice - A run of anchor records in the resource metadata table.
- BitSlice
- A run of required-flag words in the
required_bitsblob:offis the first word,lenthe field count. - Builder
- Hash-consing arena builder. Structurally equal subtrees collapse to one
NodeIdbecause every side blob is content-interned, so equal children yield equalNodevalues. - Compile
Options - Options that govern lowering. Language-affecting choices (
object_closure,format_assertion) are resolved into node fields at build time;max_diagnosticsbounds the diagnostics buffer. - Contains
Constraint - A
containsassertion:min..=maxelements (independent ofitems/prefixItems) must satisfypolicy. Not a regular-language property, so this always needscrate::structured. - Dependent
Required Pair - One decoded-name presence implication used by
dependentRequired. - Dependent
Required Slice - A run of
(trigger, required)property-name pairs. - LitSlice
- A run of
ScalarLitvalues in theliteralsblob. - Prop
Slice - A run of
(name, child)pairs in thepropsblob. - RefSlice
- A run of
NodeIdbranches in thenode_refsblob, in declaration order. - Resource
Id - Dense frozen schema-resource identifier.
- Resource
Record - Frozen metadata for one Draft 2020-12 schema resource.
- SchemaIR
- The arena IR. Built once and frozen; all fields private.
- StrRef
- A run of bytes in the
stringsblob (a UTF-8 substring).
Enums§
- Additional
Policy - How an open object treats keys past
known/patterns. - Charset
- The byte alphabet a bounded string is drawn from. The discriminant is the stable wire/hash code; variants are append-only (a reorder is a wire break and bumps the envelope format).
- Contains
Policy - What
containsrequires an element to be, independent ofitems/prefixItems. - Items
Policy - What an array’s elements must satisfy. Unlike
AdditionalPolicy, there is noForbid: an array always accepts elements, only their type may be unconstrained. - Node
- One arena node. Children are
NodeIdindices; scalars live in side blobs.#[non_exhaustive]. - Object
Closure - How an object treats properties not named in
fields. Discriminant is the stable code. - Scalar
Lit - A literal usable as a
constvalue or anenummember. - Unevaluated
Kind - Which instance type a
Node::Unevaluatedobligation targets. - Unsupported
Policy - What the compiler does when an occurrence is
Unsupported. Discriminant is the stable code.
Constants§
- IR_
VERSION - The IR schema version. Checked exactly on every wire crossing and folded into the content hash.