Skip to main content

Module framing

Module framing 

Source
Expand description

Length-prefixed framing: [u32 BE length][u8 kind][payload].

The FrameCodec is a Tokio Decoder + Encoder that converts raw byte streams into typed Frame values. Both MessagePack (default) and JSON (debug) encodings are supported; the choice is set once at construction and must match the Go supervisor’s transport.Conn encoding.

Frame kind constants align with go/transport:

  • KIND_REQUEST = 1 — Go → Rust
  • KIND_RESPONSE = 2 — Rust → Go
  • KIND_EVENT = 3 — Rust → Go (async, unsolicited)

Structs§

FrameCodec
Stateless codec; encoding is fixed at construction.

Enums§

Encoding
Frame
A decoded wire frame.

Constants§

KIND_EVENT
KIND_REQUEST
KIND_RESPONSE
MAX_FRAME_PAYLOAD
Hard cap matching transport.Conn read loop (64 MiB).