pub struct PrimaryTerm(/* private fields */);Expand description
Recovery-stable positive public optimistic-concurrency term.
Implementations§
Source§impl PrimaryTerm
impl PrimaryTerm
pub fn new(value: u64) -> Result<Self, IdentityError>
pub fn from_parts( recovery_generation: RecoveryGeneration, epoch: Epoch, ) -> Result<Self, IdentityError>
Sourcepub const fn from_genesis_epoch(epoch: Epoch) -> Self
pub const fn from_genesis_epoch(epoch: Epoch) -> Self
Constructs the term for a freshly bootstrapped writer before any total recovery generation change.
pub const fn get(self) -> u64
pub const fn epoch_component(self) -> Epoch
pub const fn recovery_generation_component(self) -> RecoveryGeneration
Trait Implementations§
Source§impl Clone for PrimaryTerm
impl Clone for PrimaryTerm
impl Copy for PrimaryTerm
Source§impl Debug for PrimaryTerm
impl Debug for PrimaryTerm
Source§impl<'de> Deserialize<'de> for PrimaryTerm
impl<'de> Deserialize<'de> for PrimaryTerm
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 PrimaryTerm
impl Display for PrimaryTerm
impl Eq for PrimaryTerm
Source§impl Hash for PrimaryTerm
impl Hash for PrimaryTerm
Source§impl Ord for PrimaryTerm
impl Ord for PrimaryTerm
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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for PrimaryTerm
impl PartialEq for PrimaryTerm
Source§impl PartialOrd for PrimaryTerm
impl PartialOrd for PrimaryTerm
Source§impl Serialize for PrimaryTerm
impl Serialize for PrimaryTerm
impl StructuralPartialEq for PrimaryTerm
Auto Trait Implementations§
impl Freeze for PrimaryTerm
impl RefUnwindSafe for PrimaryTerm
impl Send for PrimaryTerm
impl Sync for PrimaryTerm
impl Unpin for PrimaryTerm
impl UnsafeUnpin for PrimaryTerm
impl UnwindSafe for PrimaryTerm
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