#[non_exhaustive]pub enum KafkaPosition {
Earliest,
Latest,
Timestamp(i64),
Offset {
topic: Option<String>,
partition: i32,
offset: i64,
},
}Expand description
Where a subscription should resume reading.
The stream-wide variants (Earliest, Latest,
Timestamp) apply to every partition currently assigned to this
consumer; Offset names one partition. Build them with the constructors
(earliest, offset, …) - the variants are what the
seeker matches on.
§Examples
use ruststream_rdkafka::KafkaPosition;
let replay_all = KafkaPosition::earliest();
let skip_ahead = KafkaPosition::offset(3, 1_024);
let since_noon = KafkaPosition::timestamp(1_767_000_000_000);Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Earliest
The earliest offset still retained, on every assigned partition.
Latest
The end of the log, on every assigned partition, as the broker reports it while the seek runs: records published after that point arrive normally, everything before is skipped.
Timestamp(i64)
The first record at or after this timestamp (epoch milliseconds), resolved per assigned partition. A partition with no such record resumes at its end.
Offset
An absolute offset on one partition.
Fields
topic: Option<String>The topic, when the position names one. Positioned
captures the delivery’s own topic here; offset leaves it unset,
which repositions that partition index on every assigned topic (one topic being the
usual case).
Implementations§
Source§impl KafkaPosition
impl KafkaPosition
Trait Implementations§
Source§impl Clone for KafkaPosition
impl Clone for KafkaPosition
Source§fn clone(&self) -> KafkaPosition
fn clone(&self) -> KafkaPosition
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more