pub struct RecordMetadata { /* private fields */ }Expand description
The metadata for a record that has been acknowledged by the server.
Implementations§
Source§impl RecordMetadata
impl RecordMetadata
Sourcepub const INVALID_OFFSET: i64 = -1
pub const INVALID_OFFSET: i64 = -1
Value used when the offset is unknown (i.e., ProduceResponse.INVALID_OFFSET).
Sourcepub const UNKNOWN_PARTITION: i32 = -1
pub const UNKNOWN_PARTITION: i32 = -1
Partition value for record without partition assigned.
Sourcepub fn new(
topic_partition: TopicPartition,
base_offset: i64,
batch_index: i32,
timestamp: i64,
serialized_key_size: i32,
serialized_value_size: i32,
) -> Self
pub fn new( topic_partition: TopicPartition, base_offset: i64, batch_index: i32, timestamp: i64, serialized_key_size: i32, serialized_value_size: i32, ) -> Self
Creates a new instance with the provided parameters.
Sourcepub fn has_offset(&self) -> bool
pub fn has_offset(&self) -> bool
Indicates whether the record metadata includes the offset.
Sourcepub fn offset(&self) -> i64
pub fn offset(&self) -> i64
The offset of the record in the topic/partition.
Returns -1 if has_offset() returns false.
Sourcepub fn has_timestamp(&self) -> bool
pub fn has_timestamp(&self) -> bool
Indicates whether the record metadata includes the timestamp.
Sourcepub fn timestamp(&self) -> i64
pub fn timestamp(&self) -> i64
The timestamp of the record in the topic/partition.
Returns -1 if has_timestamp() returns false.
Sourcepub fn serialized_key_size(&self) -> i32
pub fn serialized_key_size(&self) -> i32
The size of the serialized, uncompressed key in bytes. Returns -1 if key is null.
Sourcepub fn serialized_value_size(&self) -> i32
pub fn serialized_value_size(&self) -> i32
The size of the serialized, uncompressed value in bytes. Returns -1 if value is null.
Sourcepub fn topic_partition(&self) -> &TopicPartition
pub fn topic_partition(&self) -> &TopicPartition
The topic and partition the record was sent to.
Trait Implementations§
Source§impl Clone for RecordMetadata
impl Clone for RecordMetadata
Source§fn clone(&self) -> RecordMetadata
fn clone(&self) -> RecordMetadata
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more