Expand description
The family’s one wire codec: compact JSON, UTF-8, one frame per \n, 16 MiB cap.
Re-exported from mcpmesh-codec — ONE implementation, provably shared with the
daemon side (mcpmesh_net::framing re-exports the same crate), so the two ends
cannot drift. mcpmesh-codec links no iroh, so this stays a no-iroh client crate.
Structs§
- Frame
Reader - NDJSON frame reader over any
AsyncRead. Reads byte-at-a-time from an INTERNALBufReader(misuse-proof: callers cannot forget the buffering and pay a poll-per-byte penalty).
Enums§
- Inbound
- One inbound frame, or a framing violation (kept distinct so callers can log/strike).
- Violation
- How an inbound frame violated the codec.
#[non_exhaustive]so a future violation kind is not a breaking change — match with a wildcard arm.
Constants§
- MAX_
FRAME_ BYTES - 16 MiB — the family frame cap. App payloads are ≤1 MiB by policy.
Functions§
- write_
frame - Serialize
frameand write it terminated by\n, flushing (a BufWriter-safe no-op for unbuffered writers — makes BufWriter wrapping misuse-proof).