Expand description
Cross-language wire format for FunctionBlob serialization.
This module provides a stable, versioned binary format for FunctionBlobs that can be implemented in any language. The format is designed for:
- Deterministic serialization (same blob = same bytes)
- Forward compatibility (new fields are appendable)
- Language independence (no Rust-specific constructs)
§Wire Format Layout
+-------------------+
| BlobHeader (50 B) |
+-------------------+
| Section Table | (section_count * 18 bytes)
+-------------------+
| Section 0 data |
+-------------------+
| Section 1 data |
+-------------------+
| ... |
+-------------------+The encoder accepts pre-serialized section payloads via EncodableBlob,
keeping this module free of shape-vm dependencies (which would create a
circular crate dependency). Higher-level code (in shape-vm) provides a
From<&FunctionBlob> conversion into EncodableBlob.
Structs§
- Blob
Decoder - Decodes wire-format bytes into a
DecodedBlob. - Blob
Encoder - Encodes an
EncodableBlobinto the cross-language wire format. - Blob
Header - Wire format header for a serialized blob.
- Blob
Metadata - Metadata section content.
- Blob
Section Entry - A section table entry in the wire format.
- Decoded
Blob - A fully decoded blob from wire format.
- Encodable
Blob - A blob prepared for wire-format encoding.
- Type
Field Mapping - A field within a type mapping.
- Type
Mapping - Type mapping specification for cross-language interop.
- Type
Mapping Registry - Registry for cross-language type mappings, keyed by schema hash.
Enums§
- Section
Type - Section types in the wire format.
- Wire
Format Error - Errors that can occur during wire format encoding/decoding.
- Wire
Type - Language-independent type descriptors for cross-language interop.
Constants§
- BLOB_
MAGIC - Magic bytes identifying a Shape blob file.
- WIRE_
FORMAT_ VERSION - Wire format version.
Functions§
- validate_
blob - Verify magic, version, and content hash of a wire-format blob.