Expand description
Kafka wire protocol — types, framing, record batches, compression, version negotiation.
§Layout
Each module owns its data, its operations, and its error (mod foo →
foo.rs + foo/error.rs). The crate root re-exports the user-facing surface
and the symbols generated/ references via use crate::*.
| Module | Responsibility |
|---|---|
primitives | Fixed-width int/float/bool + (un)signed varint(long) helpers. |
string | KafkaString + length-prefixed string read/write helpers. |
bytes_io | Length-prefixed raw byte read/write helpers. |
uuid | KafkaUuid + base64 URL-safe parsing (Java-compat). |
tagged | RawTaggedField + flexible-version tagged-field section. |
crc | CRC32C compute + validation. |
frame | TCP length-prefix framing + request encoding helpers. |
record | Record batch v2: RecordBatch, Record, RecordHeader. |
compression | Codec dispatch (gzip/snappy/lz4/zstd, feature-gated). |
version | API version resolution + header version selection. |
generated | Codegen output (committed). One module per Kafka message. |
§Errors
Each module exposes its own error type co-located in foo/error.rs.
The top-level ProtocolError is a thin facade that #[from]-converts
every module error so callers crossing layer boundaries can propagate
errors with a single ?. See crate::error for the full mapping.
Re-exports§
pub use crate::error::ProtocolError;pub use crate::error::Result;pub use crate::string::KafkaString;pub use crate::tagged::RawTaggedField;pub use crate::uuid::KafkaUuid;pub use crate::version::UnsupportedFieldVersion;pub use crate::version::UnsupportedVersion;
Modules§
- bytes_
io - Kafka length-prefixed byte payloads.
- compression
- Record-batch compression codecs.
- crc
- CRC32C checksum compute + validation.
- error
- Top-level protocol error — a thin facade over the per-module error types.
- frame
- TCP wire framing.
- generated
- Generated Kafka protocol message types — DO NOT EDIT
- primitives
- Fixed-width and varint primitive read/write helpers.
- record
- Kafka record batch v2 support.
- string
- UTF-8 strings and Kafka’s fixed/compact length-prefixed encodings.
- tagged
- Tagged-fields section for flexible Kafka message versions.
- uuid
KafkaUuid— 128-bit UUID with Kafka-specific encoding.- version
- API version resolution + header version selection.