Expand description
Tagged-map serialization format for Noir bytecode.
Design: issue #12554.
This crate currently provides:
- The
MsgpackTaggedtrait — metadata-only, exposing each type’s wire shape viaTaggedplus a hook for building aTagRegistry. TagRegistry/Entry— the runtime data structure populated by recursiveMsgpackTagged::register_intocalls and consulted by the wrapper Serializer/Deserializer (added in a follow-up step).
Re-exports§
pub use deserializer::Deserializer;pub use deserializer::msgpack_tagged_deserialize;pub use serializer::Serializer;pub use serializer::msgpack_tagged_serialize;
Modules§
- containers 🔒
- Blanket
MsgpackTaggedimpls for stdlib container types. - deserializer
- Tagged-map msgpack deserializer that wraps [
rmp_serde::Deserializer]. - primitives 🔒
- Blanket
MsgpackTaggedimpls for scalar primitives. - registry 🔒
- Local registry of types participating in tagged-map serialization.
- serializer
- Tagged-map msgpack serializer that wraps [
rmp_serde::Serializer].
Structs§
- Entry
- A registered type’s metadata. Stores only the type’s
Taggedshape alongside aTypeIdused to detect serde-name collisions between different Rust types. - Product
- A product type — a fixed list of named, integer-tagged fields. Used for top-level structs/tuple structs and for an enum variant’s payload (a variant is structurally just a struct hung off a tag).
- Sum
- A sum type — a discriminated union of
Variants. - TagRegistry
- A registry of types participating in tagged-map serialization.
- Variant
- One variant of a sum type. Its payload is a single
Product(possibly with no fields for unit and newtype variants — seeVariantKindfor the discriminator that distinguishes them).
Enums§
- Encoding
Strategy - On-wire shape for product types (structs, tuple structs, enum-variant
payloads). Picked per-type on the
Serializer(seeSerializer::new/Serializer::with_strategy). Enum variants are always int-keyed underMsgpackTaggedregardless of strategy — the strategy only affects struct shape. - Tagged
- The wire shape of a tagged type, used both at the top level (in
MsgpackTagged::TAGGED) and recursively inside variant payloads. - Variant
Kind - The shape of an enum variant’s payload, used by the wrapper to decide how to encode/decode the value carried under the variant tag.
Traits§
- Msgpack
Tagged - A type that participates in the tagged-map wire format.
Functions§
- type_
name_ basename - The basename component of
std::any::type_name::<T>()— module path stripped, generic parameters dropped. Used by the strategy-override machinery to look up registered types by the same serde name that#[serde(rename = "...")](or the bare type ident) maps to.
Type Aliases§
- Tag
- The integer tag used as a wire-level identifier for struct fields and enum
variants.
u8keeps tags inside msgpack’sfixintrange (0–127) at the 1-byte-per-tag encoding and rejects#[tag(N)]annotations withN > 255at compile time.