pub struct FenceEpoch(/* private fields */);Expand description
A monotonic epoch counter used for fencing stale operations.
Epochs are totally ordered unsigned 64-bit integers. A higher epoch supersedes all lower epochs — any operation stamped with a lower epoch than the current one is considered stale.
Implementations§
Source§impl FenceEpoch
impl FenceEpoch
Sourcepub fn is_stale(&self, current: &FenceEpoch) -> bool
pub fn is_stale(&self, current: &FenceEpoch) -> bool
Returns true if this epoch is strictly behind current.
Sourcepub fn is_current(&self, current: &FenceEpoch) -> bool
pub fn is_current(&self, current: &FenceEpoch) -> bool
Returns true if this epoch equals current.
Sourcepub fn is_newer(&self, other: &FenceEpoch) -> bool
pub fn is_newer(&self, other: &FenceEpoch) -> bool
Returns true if this epoch is strictly ahead of other.
Sourcepub fn from_generation(generation: u64) -> Self
pub fn from_generation(generation: u64) -> Self
Create a fence epoch seeded from a lease’s generation counter.
This bridges graph-level generation tracking (e.g.
[grafos_core::LeaseRef::generation]) with the fencing primitives
in this crate, allowing stale-write rejection based on lease
generation numbers.
Sourcepub fn bump(&self) -> FenceEpoch
pub fn bump(&self) -> FenceEpoch
Returns a new epoch one greater than this one.
Trait Implementations§
Source§impl Clone for FenceEpoch
impl Clone for FenceEpoch
Source§fn clone(&self) -> FenceEpoch
fn clone(&self) -> FenceEpoch
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 FenceEpoch
impl Debug for FenceEpoch
Source§impl<'de> Deserialize<'de> for FenceEpoch
impl<'de> Deserialize<'de> for FenceEpoch
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 FenceEpoch
impl Display for FenceEpoch
Source§impl Hash for FenceEpoch
impl Hash for FenceEpoch
Source§impl Ord for FenceEpoch
impl Ord for FenceEpoch
Source§fn cmp(&self, other: &FenceEpoch) -> Ordering
fn cmp(&self, other: &FenceEpoch) -> Ordering
1.21.0 · 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 FenceEpoch
impl PartialEq for FenceEpoch
Source§impl PartialOrd for FenceEpoch
impl PartialOrd for FenceEpoch
Source§impl Serialize for FenceEpoch
impl Serialize for FenceEpoch
impl Copy for FenceEpoch
impl Eq for FenceEpoch
impl StructuralPartialEq for FenceEpoch
Auto Trait Implementations§
impl Freeze for FenceEpoch
impl RefUnwindSafe for FenceEpoch
impl Send for FenceEpoch
impl Sync for FenceEpoch
impl Unpin for FenceEpoch
impl UnwindSafe for FenceEpoch
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