[][src]Struct rdkafka::message::OwnedMessage

pub struct OwnedMessage { /* fields omitted */ }

An OwnedMessage can be created from a BorrowedMessage using the BorrowedMessage::detach method. OwnedMessages don't hold any reference to the consumer and don't use any memory inside the consumer buffer.

Methods

impl OwnedMessage[src]

pub fn new(
    payload: Option<Vec<u8>>,
    key: Option<Vec<u8>>,
    topic: String,
    timestamp: Timestamp,
    partition: i32,
    offset: i64,
    headers: Option<OwnedHeaders>
) -> OwnedMessage
[src]

Create a new message with the specified content. Mainly useful for writing tests.

Trait Implementations

impl Message for OwnedMessage[src]

type Headers = OwnedHeaders

Represent the type of headers that this message contains.

fn payload_view<P: ?Sized + FromBytes>(&self) -> Option<Result<&P, P::Error>>[src]

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 Read more

fn key_view<K: ?Sized + FromBytes>(&self) -> Option<Result<&K, K::Error>>[src]

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 Read more

impl Debug for OwnedMessage[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.