Skip to main content

MessageSpec

Struct MessageSpec 

Source
pub struct MessageSpec {
    pub name: String,
    pub message_type: MessageType,
    pub api_key: Option<i16>,
    pub valid_versions: VersionRange,
    pub latest_version_unstable: bool,
    pub flexible_versions: FlexibleVersions,
    pub fields: Vec<FieldSpec>,
    pub common_structs: Vec<CommonStruct>,
    pub internal: bool,
}
Expand description

One parsed Kafka message schema.

Fields§

§name: String§message_type: MessageType§api_key: Option<i16>§valid_versions: VersionRange§latest_version_unstable: bool

Kafka’s latestVersionUnstable. When it is true, the highest version in valid_versions is still in development. A Kafka broker advertises that version only with unstable.api.versions.enable, and a Kafka client never picks it. The key is optional in the schema, and Kafka reads a missing key as false.

§flexible_versions: FlexibleVersions§fields: Vec<FieldSpec>§common_structs: Vec<CommonStruct>§internal: bool

krabka-internal RPC with no upstream Apache Kafka equivalent, for example the KIP-966 GetReplicaLogInfo controller↔broker RPC. The JVM differential sweep excludes such messages, because the oracle has no matching message class and krabka owns their wire shape outright.

Implementations§

Source§

impl MessageSpec

Source

pub fn latest_stable_version(&self) -> i16

The highest version that a client can send, which is Kafka’s ApiMessageType.highestSupportedVersion(false).

It is one less than valid_versions.max when the latest version is unstable. The result is less than valid_versions.min when the only version is unstable. Kafka reads that as “no enabled version”.

Trait Implementations§

Source§

impl Debug for MessageSpec

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for MessageSpec

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.