pub struct RecordMetadata { /* private fields */ }Expand description
Metadata returned after a produce operation.
With Acks::None, the request was written and flushed but Kafka does not
send a response, so Self::offset is -1 and broker acceptance cannot be
confirmed by the client.
Implementations§
Source§impl RecordMetadata
impl RecordMetadata
Sourcepub fn new(
topic: impl Into<String>,
partition: i32,
offset: i64,
timestamp: Option<SystemTime>,
) -> Self
pub fn new( topic: impl Into<String>, partition: i32, offset: i64, timestamp: Option<SystemTime>, ) -> Self
Creates metadata for a produced record.
Sourcepub fn offset(&self) -> i64
pub fn offset(&self) -> i64
Returns the base offset reported by Kafka.
This is -1 when an idempotent retry receives Kafka’s duplicate
sequence response because the original append offset is not available,
or when the producer uses Acks::None and Kafka sends no response.
Sourcepub fn timestamp(&self) -> Option<SystemTime>
pub fn timestamp(&self) -> Option<SystemTime>
Returns the timestamp associated with the produced record.
Trait Implementations§
Source§impl Clone for RecordMetadata
impl Clone for RecordMetadata
Source§fn clone(&self) -> RecordMetadata
fn clone(&self) -> RecordMetadata
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 RecordMetadata
impl Debug for RecordMetadata
impl Eq for RecordMetadata
Source§impl PartialEq for RecordMetadata
impl PartialEq for RecordMetadata
impl StructuralPartialEq for RecordMetadata
Auto Trait Implementations§
impl Freeze for RecordMetadata
impl RefUnwindSafe for RecordMetadata
impl Send for RecordMetadata
impl Sync for RecordMetadata
impl Unpin for RecordMetadata
impl UnsafeUnpin for RecordMetadata
impl UnwindSafe for RecordMetadata
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