Expand description
Static field-offset table for the host <-> wasm binary handshake.
Spec: docs/internal/adr/wasm-binary-layout-v1-2026-05-16.md,
“basic type layout” + “slot alignment rule” sections.
v1 scope (Phase 2.a / 2.b / 2.c):
- Phase 2.a / 2.b: the four scalar leaves —
Int,Float,Bool,Unit— are laid out inline. Each field’s start offset is rounded up to its alignment; the root is padded toroot_alignso the next record starts aligned. - Phase 2.c+: variable fields (
String,List<T>, nested schemas,Option<T>, andResult<T, E>) use pointer indirection. Each contributes a fixed-areau32pointer slot (size = 4, align = 4); the payload lives in a tail area thecrate::buffer::BufferBuilderappends after the root record.
Structs§
- Field
Offset - One field’s slot inside a record.
- Offset
Table - Computed offset table for a schema’s flat record area.
- Schema
Layout - Schema-level layout entry point. Computes the offset table for the flat record area; tail-area layout (for String / List in Phase 2.b) will be returned through a sibling helper once those types land.
Enums§
- Field
Kind - How a field is stored relative to the buffer record.
- Layout
Error - Reasons offset computation can fail.
- List
Element Kind - Phase 10-c: per-element layout descriptor for a
List<T>field.