Trait ProtocolRequest
pub trait ProtocolRequest: Encode {
type Response: for<'de> Decode<'de>;
const API_KEY: i16;
const MIN_VERSION: i16;
const MAX_VERSION: i16;
const LATEST_STABLE_VERSION: i16;
const FLEXIBLE_MIN: i16;
}Expand description
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.
Required Associated Constants§
const MIN_VERSION: i16
const MIN_VERSION: i16
Minimum protocol version this Rust type supports.
const MAX_VERSION: i16
const MAX_VERSION: i16
Maximum protocol version this Rust type can encode and decode.
This includes a version that the schema marks
latestVersionUnstable, so a broker can still decode that version
when it enables unstable versions. A client picks its version with
Self::LATEST_STABLE_VERSION.
const LATEST_STABLE_VERSION: i16
const LATEST_STABLE_VERSION: i16
Highest protocol version that a client can send.
This is Kafka’s ApiKeys.latestVersion(false). It is
MAX_VERSION - 1 when the schema sets latestVersionUnstable, and
MAX_VERSION otherwise. A value below MIN_VERSION means that the
request has no stable version.
const FLEXIBLE_MIN: i16
const FLEXIBLE_MIN: i16
First version that uses flexible framing from KIP-482.
This is i16::MAX for never-flexible messages.
Required Associated Types§
type Response: for<'de> Decode<'de>
type Response: for<'de> Decode<'de>
Matching response type from krabka-protocol.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".