Skip to main content

Module blob_wire_format

Module blob_wire_format 

Source
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§

BlobDecoder
Decodes wire-format bytes into a DecodedBlob.
BlobEncoder
Encodes an EncodableBlob into the cross-language wire format.
BlobHeader
Wire format header for a serialized blob.
BlobMetadata
Metadata section content.
BlobSectionEntry
A section table entry in the wire format.
DecodedBlob
A fully decoded blob from wire format.
EncodableBlob
A blob prepared for wire-format encoding.
TypeFieldMapping
A field within a type mapping.
TypeMapping
Type mapping specification for cross-language interop.
TypeMappingRegistry
Registry for cross-language type mappings, keyed by schema hash.

Enums§

SectionType
Section types in the wire format.
WireFormatError
Errors that can occur during wire format encoding/decoding.
WireType
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.