Skip to main content

Module wire_conversion

Module wire_conversion 

Source
Expand description

Conversion between runtime values and wire format.

Phase 2b kind-threaded rewrite. Public functions take (bits: u64, kind: NativeKind) pairs threaded from the FunctionBlob’s compile- time slot-kind metadata; internal dispatch is a match kind { ... } with no tag-bit probing. Heap slots use NativeKind::Ptr(HeapKind) — the kind tells the dispatcher which HeapValue arm decodes the bits without probing the heap object’s self-reported discriminant in production (debug-only consistency check).

See docs/defections.md 2026-05-06 (Phase 2b unified marshal + wire/snapshot kind threading) for the architectural rationale.

§API

Functions§

datatable_from_ipc_bytes
datatable_to_ipc_bytes
datatable_to_wire
heap_value_to_wire
Project a &HeapValue to WireValue by dispatching on its surviving variants. Reused by the snapshot path (Phase 2b snapshot.rs commit) which has the same heap projection needs.
slot_extract_content
If the slot carries a renderable Content shape (Content node, DataTable, or TableView), return (content_json, content_html, content_terminal). Otherwise all three are None.
slot_to_envelope
Wrap a typed slot in a ValueEnvelope with optional metadata.
slot_to_wire
Project a typed slot’s (bits, kind) to a WireValue.
wire_to_slot
Project a WireValue to typed slot bits, given the kind the caller wants. Returns [MarshalError::KindMismatch] when wire shape doesn’t match the expected kind.