Skip to main content

Crate kacrab_protocol

Crate kacrab_protocol 

Source
Expand description

Kafka wire protocol — types, framing, record batches, compression, version negotiation.

§Layout

Each module owns its data, its operations, and its error (mod foofoo.rs + foo/error.rs). The crate root re-exports the user-facing surface and the symbols generated/ references via use crate::*.

ModuleResponsibility
primitivesFixed-width int/float/bool + (un)signed varint(long) helpers.
stringKafkaString + length-prefixed string read/write helpers.
bytes_ioLength-prefixed raw byte read/write helpers.
uuidKafkaUuid + base64 URL-safe parsing (Java-compat).
taggedRawTaggedField + flexible-version tagged-field section.
crcCRC32C compute + validation.
frameTCP length-prefix framing + request encoding helpers.
recordRecord batch v2: RecordBatch, Record, RecordHeader.
compressionCodec dispatch (gzip/snappy/lz4/zstd, feature-gated).
versionAPI version resolution + header version selection.
generatedCodegen 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.