Struct rdkafka::producer::FutureRecord
source · pub struct FutureRecord<'a, K: ToBytes + ?Sized, P: ToBytes + ?Sized> {
pub topic: &'a str,
pub partition: Option<i32>,
pub payload: Option<&'a P>,
pub key: Option<&'a K>,
pub timestamp: Option<i64>,
pub headers: Option<OwnedHeaders>,
}
Expand description
A record for the future producer.
Like BaseRecord
, but specific to the FutureProducer
. The only
difference is that the FutureRecord doesn’t provide custom delivery opaque
object.
Fields§
§topic: &'a str
Required destination topic.
partition: Option<i32>
Optional destination partition.
payload: Option<&'a P>
Optional payload.
key: Option<&'a K>
Optional key.
timestamp: Option<i64>
Optional timestamp.
headers: Option<OwnedHeaders>
Optional message headers.
Implementations§
source§impl<'a, K: ToBytes + ?Sized, P: ToBytes + ?Sized> FutureRecord<'a, K, P>
impl<'a, K: ToBytes + ?Sized, P: ToBytes + ?Sized> FutureRecord<'a, K, P>
sourcepub fn to(topic: &'a str) -> FutureRecord<'a, K, P>
pub fn to(topic: &'a str) -> FutureRecord<'a, K, P>
Creates a new record with the specified topic name.
sourcepub fn partition(self, partition: i32) -> FutureRecord<'a, K, P>
pub fn partition(self, partition: i32) -> FutureRecord<'a, K, P>
Sets the destination partition of the record.
sourcepub fn payload(self, payload: &'a P) -> FutureRecord<'a, K, P>
pub fn payload(self, payload: &'a P) -> FutureRecord<'a, K, P>
Sets the destination payload of the record.
sourcepub fn key(self, key: &'a K) -> FutureRecord<'a, K, P>
pub fn key(self, key: &'a K) -> FutureRecord<'a, K, P>
Sets the destination key of the record.
sourcepub fn timestamp(self, timestamp: i64) -> FutureRecord<'a, K, P>
pub fn timestamp(self, timestamp: i64) -> FutureRecord<'a, K, P>
Sets the destination timestamp of the record.
sourcepub fn headers(self, headers: OwnedHeaders) -> FutureRecord<'a, K, P>
pub fn headers(self, headers: OwnedHeaders) -> FutureRecord<'a, K, P>
Sets the headers of the record.
Trait Implementations§
Auto Trait Implementations§
impl<'a, K, P> Freeze for FutureRecord<'a, K, P>
impl<'a, K, P> RefUnwindSafe for FutureRecord<'a, K, P>
impl<'a, K, P> Send for FutureRecord<'a, K, P>
impl<'a, K, P> Sync for FutureRecord<'a, K, P>
impl<'a, K, P> Unpin for FutureRecord<'a, K, P>
impl<'a, K, P> UnwindSafe for FutureRecord<'a, K, P>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more