pub enum PulsarPosition {
Earliest,
Latest,
MessageId(MessageIdData),
Timestamp(u64),
}Expand description
A position in a topic’s retained log, accepted by
Seeker::seek.
Captured positions (Positioned::position) carry the pinned semantics the framework
defines: seeking to one redelivers exactly that message. The timestamp form keeps the
broker’s own publish-time semantics instead.
The constructors exist because the start_at(..) clause of #[subscriber] recovers the
position type from the constructor path; a bare variant path does not name its type in the
tokens the macro sees.
§Examples
use ruststream_pulsar::PulsarPosition;
let from_the_top = PulsarPosition::earliest();
let from_now_on = PulsarPosition::latest();
let from_a_point_in_time = PulsarPosition::timestamp(1_700_000_000_000);Variants§
Earliest
The beginning of the log: every message the topics still retain is redelivered.
This is a seek, not the server-side initial position, which Pulsar applies only when a
subscription is first created. A subscription is durable broker-side state, so a
start_at(PulsarPosition::earliest()) clause rewinds an existing subscription’s cursor
on every startup, replaying the retained backlog each time the service starts.
Latest
The tip of the log: only messages published after the seek are delivered.
MessageId(MessageIdData)
The position of a delivered message.
Timestamp(u64)
Publish time, in milliseconds since the Unix epoch.
Implementations§
Source§impl PulsarPosition
impl PulsarPosition
Sourcepub fn earliest() -> Self
pub fn earliest() -> Self
The beginning of the log; see PulsarPosition::Earliest for how it interacts with a
durable subscription’s cursor.
Sourcepub fn latest() -> Self
pub fn latest() -> Self
The tip of the log; see PulsarPosition::Latest.
Sourcepub fn timestamp(millis: u64) -> Self
pub fn timestamp(millis: u64) -> Self
A publish time, in milliseconds since the Unix epoch; see
PulsarPosition::Timestamp.
Trait Implementations§
Source§impl Clone for PulsarPosition
impl Clone for PulsarPosition
Source§fn clone(&self) -> PulsarPosition
fn clone(&self) -> PulsarPosition
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more