pub struct OwnedMessage { /* private fields */ }
Expand description

A Kafka message that owns its backing data.

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.

Implementations

Creates a new message with the specified content.

This function is mainly useful in tests of rust-rdkafka itself.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

The type of headers that this message contains.

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 a mutable reference to the payload of the message, or None if there is no payload. Read more

Returns the source topic of the message.

Returns the partition number where the message is stored.

Returns the offset of the message within the partition.

Returns the message timestamp.

Returns the headers of the message, or None if there are no headers.

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

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

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

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

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.