Expand description
Rivven Wire Protocol
This crate defines the wire protocol types shared between rivven-client and rivvend. It provides serialization/deserialization for all protocol messages.
§Wire Format
All messages use a unified wire format with format auto-detection:
┌─────────────────┬─────────────────┬──────────────────────────────┐
│ Length (4 bytes)│ Format (1 byte) │ Payload (N bytes) │
│ Big-endian u32 │ 0x00 = postcard │ Serialized message │
│ │ 0x01 = protobuf │ │
└─────────────────┴─────────────────┴──────────────────────────────┘- postcard (0x00): High-performance Rust-native binary format
- protobuf (0x01): Cross-language format for Go, Java, Python clients
§Protocol Stability
The enum variant order is significant for postcard serialization. Changes to variant order will break wire compatibility with existing clients/servers.
§Example
ⓘ
use rivven_protocol::{Request, Response, WireFormat};
// Serialize with format prefix
let request = Request::Ping;
let bytes = request.to_wire(WireFormat::Postcard)?;
// Deserialize with auto-detection
let (response, format) = Response::from_wire(&bytes)?;Modules§
- serde_
utils - Serde utilities for bytes serialization
Structs§
- Broker
Info - Broker/node information for metadata discovery
- Delete
Records Result - Delete records result for a partition
- Message
Data - Serialized message data for transport
- Partition
Metadata - Partition metadata for cluster discovery
- Quota
Alteration - Quota alteration request
- Quota
Entry - Quota entry in describe response
- Topic
Config Description - Topic configuration in describe response
- Topic
Config Entry - Topic configuration entry for AlterTopicConfig
- Topic
Config Value - Topic configuration value with metadata
- Topic
Metadata - Topic metadata for cluster discovery
Enums§
- Protocol
Error - Protocol error types
- Request
- Protocol request messages
- Response
- Protocol response messages
- Schema
Type - Schema type (format) for schema registry
- Wire
Format - Wire format identifier
Constants§
- MAX_
MESSAGE_ SIZE - Maximum message size (64 MiB)
- PROTOCOL_
VERSION - Protocol version for compatibility checking
Type Aliases§
- Result
- Result type for protocol operations