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§
- Cbor
Payload - CBOR-encoded schema payload (schemas + method bindings).
- Cycle
Schema Index - 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.
- Field
Schema - Describes a single field in a struct or struct variant.
- RawPostcard
Borrowed - 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.
- Schema
Hash - A content hash that uniquely identifies a type’s postcard-level structure.
- Schema
Payload - CBOR-encoded payload inside a schema wire message. A struct so new fields can be added without breaking the wire format.
- Type
Param Name - The name of a generic type parameter (e.g.
"T","K","V"). - Variant
Schema - Describes a single variant in an enum.
Enums§
- Binding
Direction - Whether a method schema binding describes args or the response type.
- Channel
Direction - 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.
- Primitive
Type - Primitive types supported by the wire format.
- Schema
Kind - 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. - Variant
Payload - 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§
- Schema
Source - 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
OpaqueSerializefor 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§
- Mixed
Schema - Type aliases for schemas during extraction (mixed temp/final IDs).
- Mixed
Schema Kind - Schema
Registry - Lookup table mapping TypeSchemaId → Schema, used for resolving type references during deserialization with translation plans.