9.1 MessagePack Codec
<peios/msgpack.h> is a small, self-contained
MessagePack codec. It exists because KMES event
payloads are MessagePack: the kernel only structurally validates a payload
on emit — it does not build or interpret it — so userspace owns the encode and
decode. This codec is that path, and its validator's acceptance is
deliberately matched to the kernel's emit-time check, so a payload this
codec produces and validates is guaranteed to be accepted by
peios_event_emit.
You can use it as a general MessagePack codec, but its reason for being is events.
It has three parts: a heap-backed writer, a stack-allocatable reader, and a validator.
9.1.1 See also #
<peios/event.h>— the KMES events these payloads travel in.- Library conventions — the sticky-error builder model the writer follows.