pub struct LeaderEpoch(pub i32);Expand description
A partition leader epoch. KIP-320 wire type: int32.
This is a monotonic per-partition counter, and every leader change
increments it. It fences stale leaders and it bounds follower log
truncation. -1, the UNKNOWN_LEADER_EPOCH sentinel, is a valid wire value
and round-trips as the inner i32. The type is ordered, so epochs compare
directly. Advance to the next epoch with LeaderEpoch::next.
Note: the deterministic consensus core, krabka-kraft-core, tracks its own
always-non-negative epoch as a u32, krabka_kraft_core::types::Epoch.
krabka-raft converts to and from this wire type at the controller
boundary.
Tuple Fields§
§0: i32Implementations§
Source§impl LeaderEpoch
impl LeaderEpoch
Trait Implementations§
Source§impl Clone for LeaderEpoch
impl Clone for LeaderEpoch
Source§fn clone(&self) -> LeaderEpoch
fn clone(&self) -> LeaderEpoch
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for LeaderEpoch
Source§impl Debug for LeaderEpoch
impl Debug for LeaderEpoch
Source§impl Default for LeaderEpoch
impl Default for LeaderEpoch
Source§fn default() -> LeaderEpoch
fn default() -> LeaderEpoch
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for LeaderEpoch
impl<'de> Deserialize<'de> for LeaderEpoch
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for LeaderEpoch
impl Display for LeaderEpoch
impl Eq for LeaderEpoch
Source§impl From<LeaderEpoch> for i32
impl From<LeaderEpoch> for i32
Source§fn from(value: LeaderEpoch) -> Self
fn from(value: LeaderEpoch) -> Self
Converts to this type from the input type.
Source§impl From<i32> for LeaderEpoch
impl From<i32> for LeaderEpoch
Source§impl Hash for LeaderEpoch
impl Hash for LeaderEpoch
Source§impl Ord for LeaderEpoch
impl Ord for LeaderEpoch
Source§fn cmp(&self, other: &LeaderEpoch) -> Ordering
fn cmp(&self, other: &LeaderEpoch) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for LeaderEpoch
impl PartialEq for LeaderEpoch
Source§fn eq(&self, other: &LeaderEpoch) -> bool
fn eq(&self, other: &LeaderEpoch) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialEq<LeaderEpoch> for i32
impl PartialEq<LeaderEpoch> for i32
Source§fn eq(&self, other: &LeaderEpoch) -> bool
fn eq(&self, other: &LeaderEpoch) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialEq<i32> for LeaderEpoch
impl PartialEq<i32> for LeaderEpoch
Source§impl PartialOrd for LeaderEpoch
impl PartialOrd for LeaderEpoch
Source§impl PartialOrd<LeaderEpoch> for i32
impl PartialOrd<LeaderEpoch> for i32
Source§impl PartialOrd<i32> for LeaderEpoch
impl PartialOrd<i32> for LeaderEpoch
Source§impl Serialize for LeaderEpoch
impl Serialize for LeaderEpoch
impl StructuralPartialEq for LeaderEpoch
Auto Trait Implementations§
impl Freeze for LeaderEpoch
impl RefUnwindSafe for LeaderEpoch
impl Send for LeaderEpoch
impl Sync for LeaderEpoch
impl Unpin for LeaderEpoch
impl UnsafeUnpin for LeaderEpoch
impl UnwindSafe for LeaderEpoch
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