[−][src]Struct rdkafka::message::OwnedMessage
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]
payload: Option<Vec<u8>>,
key: Option<Vec<u8>>,
topic: String,
timestamp: Timestamp,
partition: i32,
offset: i64,
headers: Option<OwnedHeaders>
) -> OwnedMessage
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 key(&self) -> Option<&[u8]>
[src]
fn payload(&self) -> Option<&[u8]>
[src]
fn topic(&self) -> &str
[src]
fn partition(&self) -> i32
[src]
fn offset(&self) -> i64
[src]
fn timestamp(&self) -> Timestamp
[src]
fn headers(&self) -> Option<&OwnedHeaders>
[src]
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
impl Send for OwnedMessage
impl !Sync for OwnedMessage
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,