ffi library
The C-ABI FFI boundary (protocol.md § FFI Boundary).
Exposes LazilyFfiBytes, LazilyFfiStatus, LazilyFfiMessageKind (with
CrdtSync = 3), and the channel contract (validate / classify / clone).
Classes
- LazilyFfiBytes
-
Owned byte buffer crossing the FFI boundary
(
schemas/ffi.json#/$defs/LazilyFfiBytes). - LazilyFfiChannel
-
A simple in-process FFI channel: a send → recv relay that mirrors the C ABI
lazily_ffi_channel_send_json/lazily_ffi_channel_recv_jsonpair without a real C ABI. The bytes are decoded on send and re-encoded on recv, so a round-trip exercises the same "decode + re-encode canonical JSON" contract. - LazilyFfiClassification
- The result of a frame classification: the status plus (on success) the decoded message kind.
- LazilyFfiCloneResult
-
Clone a frame through the channel: decode the bytes as IpcMessage, then
re-encode canonical JSON bytes. Returns the re-encoded bytes on success, or
nullwith a non-ok status if the frame is invalid.
Enums
- LazilyFfiMessageKind
-
The IPC message kind discriminant
(
schemas/ffi.json#/$defs/LazilyFfiMessageKind). - LazilyFfiStatus
-
The FFI operation status code (
schemas/ffi.json#/$defs/LazilyFfiStatus).
Functions
-
lazilyFfiCloneJson(
LazilyFfiBytes frame) → LazilyFfiCloneResult -
lazilyFfiKindJson(
LazilyFfiBytes frame) → LazilyFfiClassification - Classify a frame: decode it and return the variant kind. Returns LazilyFfiStatus.invalidMessage in LazilyFfiClassification.status if the frame is not a valid IpcMessage.
-
lazilyFfiValidateJson(
LazilyFfiBytes frame) → LazilyFfiStatus - Validate a frame: decode the bytes as IpcMessage and confirm the result is well-formed. Returns LazilyFfiStatus.ok on success.