kmb-wire: Binary wire protocol for Kimberlite
This crate defines the binary wire protocol used for client-server
communication in Kimberlite.
Frame Format
┌─────────┬─────────┬──────────┬──────────┬──────────────────┐
│ Magic │ Version │ Length │ Checksum │ Payload │
│ (4 B) │ (2 B) │ (4 B) │ (4 B) │ (var) │
└─────────┴─────────┴──────────┴──────────┴──────────────────┘
- Magic:
0x56444220("VDB ") - Version: Protocol version (currently 1)
- Length: Payload length in bytes (max 16 MiB)
- Checksum: CRC32 of payload
- Payload: Bincode-encoded message
Message Types
Messages are either requests (client → server) or responses (server → client). Each request has a corresponding response type.