#[non_exhaustive]pub enum Node {
Show 21 variants
Null,
Boolean,
Never,
StringConst {
value: StrRef,
},
StringPattern {
regex: StrRef,
min_len: Option<u32>,
max_len: Option<u32>,
charset: Charset,
},
Integer {
minimum: Option<i64>,
maximum: Option<i64>,
multiple_of: Option<u64>,
},
Number {
integer_only: bool,
minimum: Option<(i128, u32, bool)>,
maximum: Option<(i128, u32, bool)>,
multiple_of: Option<(u64, u32)>,
},
LexicalNumber {
regex: StrRef,
},
Enum {
values: LitSlice,
},
Array {
items: ItemsPolicy,
min_items: u32,
max_items: Option<u32>,
unique_items: bool,
contains: Option<ContainsConstraint>,
items_annotates: bool,
},
Tuple {
prefix: RefSlice,
tail: Option<NodeId>,
min_items: u32,
max_items: Option<u32>,
unique_items: bool,
tail_annotates: bool,
contains: Option<ContainsConstraint>,
},
Object {
fields: PropSlice,
required: BitSlice,
closure: ObjectClosure,
dependent: PropSlice,
dependent_required: DependentRequiredSlice,
},
OpenObject {
known: PropSlice,
known_required: BitSlice,
patterns: PropSlice,
additional: AdditionalPolicy,
property_names: Option<NodeId>,
min_properties: Option<u32>,
max_properties: Option<u32>,
dependent: PropSlice,
dependent_required: DependentRequiredSlice,
},
Union {
branches: RefSlice,
},
Intersection {
branches: RefSlice,
},
ExactlyOne {
branches: RefSlice,
},
Not {
inner: NodeId,
},
Ref {
def: u32,
},
DynamicRef {
initial_target: NodeId,
anchor: AnchorId,
},
Unevaluated {
kind: UnevaluatedKind,
scope: NodeId,
unevaluated: NodeId,
},
Unsupported {
keyword: StrRef,
reason: UnsupportedReason,
},
}Expand description
One arena node. Children are NodeId indices; scalars live in side blobs. #[non_exhaustive].
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Null
Matches literal null.
Boolean
Matches true or false.
Never
Matches no value at all (the bare false schema). A regular language like any other leaf:
an impossible byte class, dead from the very first byte, never needs the structured backend.
StringConst
A fixed string literal.
StringPattern
A regular pattern over a chosen byte alphabet, optionally length-bounded.
Fields
Integer
A signed 64-bit integer with optional inclusive bounds and an optional exact divisor.
Fields
Number
Any JSON number with sign, integer part, and optional fraction. Bounded forms omit exponents; genuinely fractional bounds remain unsupported.
Fields
LexicalNumber
A JSON number constrained by lexical digit counts.
Enum
A closed set of scalar literals (non-empty, canonically sorted, duplicate-free).
Array
A homogeneous array with a cardinality bound.
Fields
items: ItemsPolicyWhat every element must satisfy.
unique_items: booluniqueItems: no two items may be the same JSON value. Not a regular-language property
(needs unbounded memory of prior items), so this always routes through crate::structured.
contains: Option<ContainsConstraint>contains/minContains/maxContains, when present.
Tuple
A positional (tuple) array: prefix positions validate in order, tail validates the rest
(absent = closed); length runs from min_items to max_items (and the prefix, if closed).
Fields
tail_annotates: boolWhether items was textually present past prefixItems, mirroring items_annotates.
contains: Option<ContainsConstraint>contains/minContains/maxContains, when present.
Object
An object with source-ordered fields, a positional required bitset, and a closure policy.
Fields
closure: ObjectClosureHow additional properties are treated.
dependent: PropSlicedependentSchemas: when key is present, the whole instance must also satisfy
schema. Instance-dependent, so a non-empty run always needs crate::structured.
dependent_required: DependentRequiredSlicedependentRequired flattened as decoded trigger/required name pairs.
OpenObject
An order-independent object: known properties, patternProperties, and an additional-key
policy, none of which can be represented as one finite byte-level regex.
Fields
additional: AdditionalPolicyHow a key matching neither known nor patterns is treated.
property_names: Option<NodeId>An optional schema every key (known, pattern-matched, or additional) must satisfy.
dependent_required: DependentRequiredSlicedependentRequired flattened as decoded trigger/required name pairs.
Union
A type union: matches any of its branches, in declaration order (deduplicated by type).
Intersection
An allOf: matches iff every branch matches (language intersection).
ExactlyOne
A oneOf: matches iff exactly one branch matches.
Not
Matches complete JSON values that inner does not match.
Full JSON-value complement requires crate::structured.
Ref
A recursion cut point: a leaf whose body is def_targets[def], an edge free of the back-edge
rule so a $ref cycle needs no cyclic child graph. Followed only by crate::structured.
DynamicRef
A $dynamicRef whose initially resolved fragment names a $dynamicAnchor.
Fields
Unevaluated
Requires unannotated properties or items in scope to match unevaluated.
Annotation tracking requires crate::structured.
Fields
kind: UnevaluatedKindWhich instance type this obligation targets.
Unsupported
An occurrence the dialect does not support. Carries no pointer; provenance is the sidecar.