Expand description
Type Schema Registry for JIT Type Specialization
This module provides compile-time type information for optimizing field access in the JIT compiler. When the type of an object is known, we can generate direct memory access instead of HashMap lookups.
§Overview
TypeSchema- Describes the layout of a declared typeFieldDef- Defines a single field with name, type, and offsetTypeSchemaRegistry- Global registry of all known type schemas
§Performance
Direct field access: ~2ns vs HashMap lookup: ~25ns (12x faster)
§Intersection Types
Supports merging multiple schemas for intersection types (A + B).
Field collisions are detected at compile time and result in errors.
Re-exports§
pub use builtin_schemas::BuiltinSchemaIds;pub use enum_support::EnumInfo;pub use enum_support::EnumVariantInfo;pub use field_types::FieldAnnotation;pub use field_types::FieldDef;pub use field_types::FieldType;pub use physical_binding::PhysicalSchemaBinding;pub use registry::TypeSchemaBuilder;pub use registry::TypeSchemaRegistry;pub use schema::TypeBinding;pub use schema::TypeBindingError;pub use schema::TypeSchema;
Modules§
- builtin_
schemas - Builtin schema definitions for fixed-layout runtime objects.
- enum_
support - Enum type support for type schemas
- field_
types - Field type definitions for type schemas
- intersection
- Intersection type support for type schemas
- physical_
binding - Physical schema binding for direct Arrow buffer access.
- registry
- Type schema registry and builder
- schema
- Core TypeSchema struct and methods
Enums§
- Schema
Error - Error type for schema operations
Functions§
- ensure_
next_ schema_ id_ above - Ensure all future schema IDs are strictly greater than
max_existing_id. - lookup_
schema_ by_ id_ public - Public wrapper for looking up a schema by ID across all registries (stdlib + predeclared). Used by wire_conversion when Context registry doesn’t have the schema (e.g. ad-hoc/const-eval objects).
- register_
predeclared_ any_ schema - Register a predeclared schema with
FieldType::Anyfor the given ordered fields. - typed_
object_ from_ nb_ pairs - Create an anonymous
TypedObjectfrom ValueWord field pairs. - typed_
object_ from_ pairs - Create a
ValueWord::TypedObjectfrom a list of key-value pairs. - typed_
object_ to_ hashmap - Convert a TypedObject
ValueWordback to aHashMap<String, ValueWord>. - typed_
object_ to_ hashmap_ nb - Convert a ValueWord TypedObject to a
HashMap<String, ValueWord>.
Type Aliases§
- Schema
Id - Unique identifier for a type schema