Expand description
HiveLLM binary RPC wire layer — wire v1, frozen.
One frame is u32 LE length + MessagePack body; the body is a
Request or Response in rmp-serde’s externally-tagged encoding
over the 8-variant Value model. The normative byte definition lives
in docs/spec/ (transplanted family spec); this crate is bound to it by
docs/specs/SPEC-001-wire-format.md (WIRE-xxx requirements).
Canonicalization over the donor implementations (SPEC-001 §2):
Bytesis emitted as MessagePack bin (WIRE-010) — ~33% smaller than the int-array form every pre-Thunder Rust server emits — while the legacy int-array form is accepted on decode forever (WIRE-011).Request/Responseare emitted as array-encoded structs (WIRE-012); map-shaped requests decode fine (WIRE-013, rmp-serde leniency).
This crate is pure: no sockets, no product knowledge (WIRE-030). Async
frame helpers are available behind the tokio feature.
Re-exports§
pub use config::Config;
Modules§
- config
- Protocol configuration (SPEC-002) — the declarative description of how
one application uses the shared wire. Pure data: the codec never
depends on it;
thunder::client/thunder::serverdrive their behavior from it.
Structs§
- Request
- One RPC request (WIRE-001).
idis client-chosen and echoed back; many requests multiplex over one connection. Serialized as an array (WIRE-012); map-shaped requests decode too (WIRE-013). - Response
- One RPC response (WIRE-001).
resultisOk(value)or an error string; v1 carries no structured error object — conventions are prefix-based and profile-driven (WIRE-040).
Enums§
- Decode
Error - Errors from the sync decoder.
- Value
- The wire value model (WIRE-002) — byte-compatible with the value models the family shipped before Thunder, by construction.
Constants§
- DEFAULT_
MAX_ FRAME_ BYTES - Default frame-body cap: 64 MiB, validated against the length prefix before any allocation (WIRE-020). Operators tune it per profile.
- PUSH_ID
- Reserved frame id for server-initiated push frames (WIRE-005).
Functions§
- decode_
frame - Decode one frame from a byte slice using
DEFAULT_MAX_FRAME_BYTES. - decode_
frame_ with_ limit - Decode one frame, rejecting bodies larger than
maxbefore the body is even inspected (WIRE-020/021). - encode_
frame - Encode a message into one complete frame (
u32 LE length+ body). - read_
frame - Read one frame; returns the decoded value and the frame size in
bytes (
4 + body— the metrics input, SRV-007). The cap is checked between reading the prefix and allocating the body (WIRE-020). - read_
request - Read one
Requestwith the default cap. - read_
request_ with_ limit - Read one
Requestwith a caller-supplied cap (server hot path). - read_
response - Read one
Responsewith the default cap. - read_
response_ with_ limit - Read one
Responsewith a caller-supplied cap. - write_
frame - Encode and write one frame; returns the frame size written.
- write_
request - Write one
Requestframe. - write_
response - Write one
Responseframe.