Expand description
Schema model, builder, canonical binary encoding (“VSC1”), and content hashing. The canonical form sorts types by name, fields by ID, and enum variants by value, so one logical schema has exactly one byte encoding and therefore exactly one id.
Structs§
- EnumDef
- Field
Def - Schema
- A validated schema: canonical type table, cached canonical bytes, content id, and precomputed struct layouts.
- Schema
Builder - Declaration order never matters:
buildsorts types by name and fields by ID before encoding, so equivalent declarations produce identical schema ids. - Struct
Def
Enums§
- Default
- A scalar custom default for a field: the value a reader synthesizes when
the field is absent (see
StructReader::get_or_default). v1 supports scalar defaults only; floats are stored as their bit patterns so the schema types stayEq. - Dt
- Draft type used in
SchemaBuilder: likeTypebut names other types by string instead of index (indices only exist after canonical sorting). - Struct
Mode - How a struct’s fields are stored.
- Type
- A field or element type.
Struct/Enumreference other types in the same schema by index into the canonically (name-)sorted type table. - TypeDef
Constants§
- MAX_
TYPE_ DEPTH - Maximum
list<…>nesting depth. Bounds recursion in schema decode and in resolver plan-building so a hostile schema cannot overflow the stack. Far above any real schema (a handful of levels). - SCHEMA_
MAGIC