Skip to main content

Module ir

Module ir 

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

AnchorId
Dense frozen anchor-record identifier.
AnchorRecord
Frozen static or dynamic anchor declaration.
AnchorSlice
A run of anchor records in the resource metadata table.
BitSlice
A run of required-flag words in the required_bits blob: off is the first word, len the field count.
Builder
Hash-consing arena builder. Structurally equal subtrees collapse to one NodeId because every side blob is content-interned, so equal children yield equal Node values.
CompileOptions
Options that govern lowering. Language-affecting choices (object_closure, format_assertion) are resolved into node fields at build time; max_diagnostics bounds the diagnostics buffer.
ContainsConstraint
A contains assertion: min..=max elements (independent of items/prefixItems) must satisfy policy. Not a regular-language property, so this always needs crate::structured.
DependentRequiredPair
One decoded-name presence implication used by dependentRequired.
DependentRequiredSlice
A run of (trigger, required) property-name pairs.
LitSlice
A run of ScalarLit values in the literals blob.
PropSlice
A run of (name, child) pairs in the props blob.
RefSlice
A run of NodeId branches in the node_refs blob, in declaration order.
ResourceId
Dense frozen schema-resource identifier.
ResourceRecord
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 strings blob (a UTF-8 substring).

Enums§

AdditionalPolicy
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).
ContainsPolicy
What contains requires an element to be, independent of items/prefixItems.
ItemsPolicy
What an array’s elements must satisfy. Unlike AdditionalPolicy, there is no Forbid: an array always accepts elements, only their type may be unconstrained.
Node
One arena node. Children are NodeId indices; scalars live in side blobs. #[non_exhaustive].
ObjectClosure
How an object treats properties not named in fields. Discriminant is the stable code.
ScalarLit
A literal usable as a const value or an enum member.
UnevaluatedKind
Which instance type a Node::Unevaluated obligation targets.
UnsupportedPolicy
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.