Skip to main content

Module schema

Module schema 

Source
Expand description

Schema extraction and tracking for vox wire protocol.

The canonical schema model lives in vox-schema. This module re-exports those shared types and adds vox-specific extraction plus per-connection send/receive tracking.

Structs§

CborPayload
CBOR-encoded schema payload (schemas + method bindings).
CycleSchemaIndex
Temporary index assigned during schema extraction to handle cycles in recursive types. Completely unrelated to type parameters — this is purely a bookkeeping index for the extraction/hashing pipeline.
DuplicateSchemaError
Error returned when recording received schemas detects a protocol violation.
ExtractedSchemas
Result of schema extraction: the schemas and the root TypeRef.
FieldSchema
Describes a single field in a struct or struct variant.
RawPostcardBorrowed
Transparent wrapper around borrowed bytes that are already postcard-encoded. Used as a sentinel type for passthrough detection in serializers.
Schema
The root schema type, generic over the ID representation.
SchemaHash
A content hash that uniquely identifies a type’s postcard-level structure.
SchemaPayload
CBOR-encoded payload inside a schema wire message. A struct so new fields can be added without breaking the wire format.
SchemaRecvTracker
Tracks schemas received from the remote peer on the current connection.
SchemaSendTracker
Tracks which schemas have been sent on the current connection.
TypeParamName
The name of a generic type parameter (e.g. "T", "K", "V").
VariantSchema
Describes a single variant in an enum.

Enums§

BindingDirection
Whether a method schema binding describes args or the response type.
ChannelDirection
The direction of a channel type.
MixedId
During extraction, IDs can be either already-finalized content hashes or temporary indices that will be resolved during finalization.
PrimitiveType
Primitive types supported by the wire format.
SchemaExtractError
Errors that can occur during schema extraction.
SchemaKind
The structural kind of a type, generic over the ID representation.
TypeRef
A reference to a type in a schema. Either a concrete type (with optional type arguments for generics) or a type variable bound by the enclosing generic’s type_params.
VariantPayload
The payload of an enum variant.

Statics§

RAW_POSTCARD_BORROWED_SHAPE
Sentinel shape for borrowed passthrough bytes. Serializers check against this to distinguish pre-encoded bytes from regular &[u8]/Vec<u8> values.

Traits§

SchemaSource
Anything that can look up schemas by their content hash.
Schematic
A value for which a schema can be attached

Functions§

build_registry
Build a SchemaRegistry from a list of schemas.
compute_content_hash
Compute the content hash of a schema, given a resolver for child type IDs.
extract_schemas
Extract schemas without a tracker (uses a temporary counter). Useful for tests and one-off schema extraction.
opaque_encoded_borrowed
Create an OpaqueSerialize for already-encoded postcard bytes. The serializer detects the sentinel shape and writes bytes directly (passthrough).
schema_child_ids
Collect all TypeSchemaIds directly referenced by a SchemaKind.

Type Aliases§

MixedSchema
Type aliases for schemas during extraction (mixed temp/final IDs).
MixedSchemaKind
SchemaRegistry
Lookup table mapping TypeSchemaId → Schema, used for resolving type references during deserialization with translation plans.