pub struct ProducerState { /* private fields */ }Expand description
The state of an active producer for a partition.
Implementations§
Source§impl ProducerState
impl ProducerState
Sourcepub fn new(
producer_id: i64,
producer_epoch: i32,
last_sequence: i32,
last_timestamp: i64,
coordinator_epoch: Option<i32>,
current_transaction_start_offset: Option<i64>,
) -> Self
pub fn new( producer_id: i64, producer_epoch: i32, last_sequence: i32, last_timestamp: i64, coordinator_epoch: Option<i32>, current_transaction_start_offset: Option<i64>, ) -> Self
Creates a new ProducerState.
§Arguments
producer_id- the producer id.producer_epoch- the producer epoch.last_sequence- the last sequence number written by this producer.last_timestamp- the timestamp of the last record written by this producer.coordinator_epoch- the epoch of the transaction coordinator, orNoneif not known.current_transaction_start_offset- the start offset of the producer’s open transaction, orNoneif there is none.
Sourcepub fn producer_id(&self) -> i64
pub fn producer_id(&self) -> i64
Returns the producer id.
Sourcepub fn producer_epoch(&self) -> i32
pub fn producer_epoch(&self) -> i32
Returns the producer epoch.
Sourcepub fn last_sequence(&self) -> i32
pub fn last_sequence(&self) -> i32
Returns the last sequence number written by this producer.
Sourcepub fn last_timestamp(&self) -> i64
pub fn last_timestamp(&self) -> i64
Returns the last timestamp written by this producer.
Sourcepub fn current_transaction_start_offset(&self) -> Option<i64>
pub fn current_transaction_start_offset(&self) -> Option<i64>
Returns the offset of the first record in the current transaction, if any.
Sourcepub fn coordinator_epoch(&self) -> Option<i32>
pub fn coordinator_epoch(&self) -> Option<i32>
Returns the coordinator epoch, if any.
Trait Implementations§
Source§impl Clone for ProducerState
impl Clone for ProducerState
Source§fn clone(&self) -> ProducerState
fn clone(&self) -> ProducerState
Returns a duplicate of the value. Read more
1.0.0 · 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 ProducerState
impl Debug for ProducerState
Source§impl Display for ProducerState
impl Display for ProducerState
Source§impl Hash for ProducerState
impl Hash for ProducerState
Source§impl PartialEq for ProducerState
impl PartialEq for ProducerState
impl Eq for ProducerState
impl StructuralPartialEq for ProducerState
Auto Trait Implementations§
impl Freeze for ProducerState
impl RefUnwindSafe for ProducerState
impl Send for ProducerState
impl Sync for ProducerState
impl Unpin for ProducerState
impl UnsafeUnpin for ProducerState
impl UnwindSafe for ProducerState
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
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
Checks if this value is equivalent to the given key. Read more
§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
Compare self to
key and return true if they are equal.§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
Checks if this value is equivalent to the given key. Read more