Skip to main content

Module type_schema

Module type_schema 

Source
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 type
  • FieldDef - Defines a single field with name, type, and offset
  • TypeSchemaRegistry - 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§

SchemaError
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::Any for the given ordered fields.
typed_object_from_nb_pairs
Create an anonymous TypedObject from ValueWord field pairs.
typed_object_from_pairs
Create a ValueWord::TypedObject from a list of key-value pairs.
typed_object_to_hashmap
Convert a TypedObject ValueWord back to a HashMap<String, ValueWord>.
typed_object_to_hashmap_nb
Convert a ValueWord TypedObject to a HashMap<String, ValueWord>.

Type Aliases§

SchemaId
Unique identifier for a type schema