rivven-protocol
Wire protocol types for Rivven, the distributed event streaming platform.
Overview
This crate provides the canonical definitions for all wire protocol types used in client-server communication. Both rivven-client and rivvend depend on this crate to ensure wire compatibility.
Features
- Request/Response enums — All 20+ request and response types
- Metadata types —
BrokerInfo,TopicMetadata,PartitionMetadata - Message types —
MessageDatawith key/value/headers - Serialization — postcard-based wire format with size validation
Protocol Constants
| Constant | Value | Description |
|---|---|---|
PROTOCOL_VERSION |
1 | Current wire protocol version |
MAX_MESSAGE_SIZE |
64MB | Maximum serialized message size |
Usage
use ;
// Create a produce request
let data = new;
let request = Produce ;
// Serialize for transmission
let bytes = request.to_bytes?;
// Deserialize on receipt
let request = from_bytes?;
Wire Format
Messages are serialized using postcard with the following guarantees:
- Compact binary encoding with COBS framing support
- Variable-length integer encoding (varint)
- #[no_std] compatible
- Maximum message size enforced before deserialization
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.