pub struct ProduceRecord {
pub topic: String,
pub partition: Option<i32>,
pub timestamp: Option<i64>,
pub headers: Vec<RecordHeader>,
pub key: Option<Bytes>,
pub value: Option<Bytes>,
}Expand description
Produce Record.
Fields§
§topic: StringTopic name.
partition: Option<i32>Partition number.
timestamp: Option<i64>Timestamp.
headers: Vec<RecordHeader>Headers.
key: Option<Bytes>Record key.
value: Option<Bytes>Record value.
Implementations§
Source§impl ProduceRecord
impl ProduceRecord
Sourcepub fn new(
topic: impl Into<String>,
partition: impl Into<Option<i32>>,
value: impl Into<Bytes>,
) -> Self
pub fn new( topic: impl Into<String>, partition: impl Into<Option<i32>>, value: impl Into<Bytes>, ) -> Self
Creates a new value.
Sourcepub fn without_partition(
topic: impl Into<String>,
value: impl Into<Bytes>,
) -> Self
pub fn without_partition( topic: impl Into<String>, value: impl Into<Bytes>, ) -> Self
Without Partition.
Sourcepub fn to_partition(
topic: impl Into<String>,
partition: i32,
value: impl Into<Bytes>,
) -> Self
pub fn to_partition( topic: impl Into<String>, partition: i32, value: impl Into<Bytes>, ) -> Self
To Partition.
Sourcepub fn tombstone(
topic: impl Into<String>,
partition: impl Into<Option<i32>>,
) -> Self
pub fn tombstone( topic: impl Into<String>, partition: impl Into<Option<i32>>, ) -> Self
Tombstone.
Sourcepub fn with_partition(self, partition: i32) -> Self
pub fn with_partition(self, partition: i32) -> Self
Sets partition and returns the updated value.
Sourcepub fn with_timestamp(self, timestamp: i64) -> Self
pub fn with_timestamp(self, timestamp: i64) -> Self
Sets timestamp and returns the updated value.
Sourcepub fn with_null_value(self) -> Self
pub fn with_null_value(self) -> Self
Sets null value and returns the updated value.
Sourcepub fn with_header(self, header: RecordHeader) -> Self
pub fn with_header(self, header: RecordHeader) -> Self
Sets header and returns the updated value.
Sourcepub fn with_headers<I>(self, headers: I) -> Selfwhere
I: IntoIterator<Item = RecordHeader>,
pub fn with_headers<I>(self, headers: I) -> Selfwhere
I: IntoIterator<Item = RecordHeader>,
Sets headers and returns the updated value.
Trait Implementations§
Source§impl Clone for ProduceRecord
impl Clone for ProduceRecord
Source§fn clone(&self) -> ProduceRecord
fn clone(&self) -> ProduceRecord
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProduceRecord
impl Debug for ProduceRecord
Source§impl From<ProduceRecord> for KafkaMessage
impl From<ProduceRecord> for KafkaMessage
Source§fn from(record: ProduceRecord) -> Self
fn from(record: ProduceRecord) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !Freeze for ProduceRecord
impl RefUnwindSafe for ProduceRecord
impl Send for ProduceRecord
impl Sync for ProduceRecord
impl Unpin for ProduceRecord
impl UnsafeUnpin for ProduceRecord
impl UnwindSafe for ProduceRecord
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