1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//! Kafka wire-protocol codec.
//!
//! `crabka-protocol` is a pure-Rust library that encodes and decodes every
//! Apache Kafka request and response message, byte-equivalent to the upstream
//! JVM implementation. It performs no I/O and makes no async assumptions; it
//! is intended to be consumed by broker, client, and tooling crates within
//! the Crabka project.
//!
//! ## Two flavors
//!
//! Every message has two generated types:
//!
//! - `owned::FooRequest` — owns its data (`String`, `Bytes`, `Vec<T>`).
//! Easy to move across `await` points.
//! - `borrowed::FooRequest<'a>` — references slices of the input buffer
//! (`&'a str`, `&'a [u8]`). Zero-copy decoding.
//!
//! Both implement [`Encode`]; the owned flavor implements [`Decode`] and the
//! borrowed flavor implements [`DecodeBorrow`].
//!
//! ## Versioning
//!
//! `crabka-protocol` is pre-1.0. Breaking API changes per minor version are
//! allowed; see CHANGELOG.md. The wire-protocol pin is recorded in
//! `crates/protocol/schemas/VERSION`.
//!
//! ## Encoding a generated request
//!
//! ```rust
//! use bytes::BytesMut;
//! use crabka_protocol::Encode;
//! use crabka_protocol::owned::api_versions_request::ApiVersionsRequest;
//!
//! let req = ApiVersionsRequest::default();
//! let version = 4;
//! let mut buf = BytesMut::with_capacity(req.encoded_len(version));
//! req.encode(&mut buf, version).unwrap();
//! assert_eq!(buf.len(), req.encoded_len(version));
//! ```
pub use ApiKey;
pub use ;
pub use ProtocolError;
pub use ;