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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
use ;
use crateProtocolError;
/// Encode a Kafka wire-protocol value into a buffer at the given protocol version.
///
/// `version` is the message-level version negotiated with `ApiVersionsRequest`.
/// Implementations must produce bytes that are byte-equal to the upstream JVM
/// `kafka-clients` implementation for the same `(message_type, version, value)`.
/// Decode a Kafka wire-protocol value from a buffer at the given protocol version.
///
/// The `'de` lifetime is the lifetime the decoded value may borrow from the input.
/// Owned-flavor types implement `Decode<'de>` for any `'de`, because their output
/// is `'static`. Borrowed-flavor types implement `Decode<'de>` where `Self: 'de`.
/// Like `Decode`, but for the borrowed, zero-copy flavors.
///
/// This trait needs a contiguous buffer, because borrowed values reference slices
/// of it.
/// Implemented by every generated Request struct in `krabka-protocol`.
///
/// The `krabka-protocol-codegen` crate emits this impl for every Request type.
/// The trait gives the client the dispatch information it needs: the api key, the
/// version range, and the response type.