Trait rdkafka::message::Message [] [src]

pub trait Message {
    fn key(&self) -> Option<&[u8]>;
fn payload(&self) -> Option<&[u8]>;
fn topic(&self) -> &str;
fn partition(&self) -> i32;
fn offset(&self) -> i64;
fn timestamp(&self) -> Timestamp; fn payload_view<P: ?Sized + FromBytes>(
        &self
    ) -> Option<Result<&P, P::Error>> { ... }
fn key_view<K: ?Sized + FromBytes>(&self) -> Option<Result<&K, K::Error>> { ... } }

The Message trait provides access to the fields of a generic Kafka message.

Required Methods

Returns the key of the message, or None if there is no key.

Returns the payload of the message, or None if there is no payload.

Returns the source topic of the message.

Returns the partition number where the message is stored.

Returns the offset of the message.

Returns the message timestamp for a consumed message if available.

Provided Methods

Converts the raw bytes of the payload to a reference of the specified type, that points to the same data inside the message and without performing any memory allocation

Converts the raw bytes of the key to a reference of the specified type, that points to the same data inside the message and without performing any memory allocation

Implementors