Skip to main content

Crate vox_schema

Crate vox_schema 

Source
Expand description

Canonical schema model and wire payload types for vox.

This crate contains the transport-independent schema data model, content hashing, and CBOR schema payload helpers shared by vox runtimes and codecs.

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.
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.
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.
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.

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.
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.