pub struct OffsetAndTimestamp { /* private fields */ }Expand description
A container class for offset and timestamp.
Corresponds to Java’s org.apache.kafka.clients.consumer.OffsetAndTimestamp.
offsets_for_times mapping note: this value is non-nullable, so when
it is the value type of an offsets_for_times result map, an unresolved
partition (queried but with no offset at/after the target time) is
omitted from the map (key absent) rather than present with a null
value as in Java. See
Consumer::offsets_for_times.
Implementations§
Source§impl OffsetAndTimestamp
impl OffsetAndTimestamp
Sourcepub fn new(offset: i64, timestamp: i64) -> Result<Self, Error>
pub fn new(offset: i64, timestamp: i64) -> Result<Self, Error>
Create a new OffsetAndTimestamp with no leader epoch.
§Errors
Returns Error::LocalIllegalArgument if offset or timestamp is
negative (matching Java’s IllegalArgumentException).
Sourcepub fn with_leader_epoch(
offset: i64,
timestamp: i64,
leader_epoch: Option<i32>,
) -> Result<Self, Error>
pub fn with_leader_epoch( offset: i64, timestamp: i64, leader_epoch: Option<i32>, ) -> Result<Self, Error>
Create a new OffsetAndTimestamp with an optional leader epoch.
§Errors
Returns Error::LocalIllegalArgument if offset or timestamp is
negative (matching Java’s IllegalArgumentException).
Sourcepub fn leader_epoch(&self) -> Option<i32>
pub fn leader_epoch(&self) -> Option<i32>
Get the leader epoch corresponding to the offset that was found (if
one exists). This can be provided to seek() to ensure the log hasn’t
been truncated prior to fetching.
Trait Implementations§
Source§impl Clone for OffsetAndTimestamp
impl Clone for OffsetAndTimestamp
Source§fn clone(&self) -> OffsetAndTimestamp
fn clone(&self) -> OffsetAndTimestamp
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OffsetAndTimestamp
impl Debug for OffsetAndTimestamp
Source§impl Display for OffsetAndTimestamp
impl Display for OffsetAndTimestamp
Source§impl Hash for OffsetAndTimestamp
impl Hash for OffsetAndTimestamp
Source§impl PartialEq for OffsetAndTimestamp
impl PartialEq for OffsetAndTimestamp
impl Eq for OffsetAndTimestamp
impl StructuralPartialEq for OffsetAndTimestamp
Auto Trait Implementations§
impl Freeze for OffsetAndTimestamp
impl RefUnwindSafe for OffsetAndTimestamp
impl Send for OffsetAndTimestamp
impl Sync for OffsetAndTimestamp
impl Unpin for OffsetAndTimestamp
impl UnsafeUnpin for OffsetAndTimestamp
impl UnwindSafe for OffsetAndTimestamp
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.