pub struct VersionVector { /* private fields */ }Expand description
Summary of “what ops a replica has seen”, indexed by replica.
vv[replica] is the highest counter ever observed from that replica.
Because counters are Lamport timestamps that strictly increase along
any causal chain, “seen (replica, counter)” implies “seen everything
from that replica with counter ≤ that counter”.
Implementations§
Source§impl VersionVector
impl VersionVector
Sourcepub fn replica_count(&self) -> usize
pub fn replica_count(&self) -> usize
Number of distinct replicas seen.
Sourcepub fn get(&self, replica: ReplicaId) -> u64
pub fn get(&self, replica: ReplicaId) -> u64
Highest counter observed from replica, or 0 if none.
Sourcepub fn iter_clocks(&self) -> impl Iterator<Item = (ReplicaId, u64)> + '_
pub fn iter_clocks(&self) -> impl Iterator<Item = (ReplicaId, u64)> + '_
Iterate (replica, highest_counter) pairs in replica-id order.
Trait Implementations§
Source§impl Clone for VersionVector
impl Clone for VersionVector
Source§fn clone(&self) -> VersionVector
fn clone(&self) -> VersionVector
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 moreSource§impl Debug for VersionVector
impl Debug for VersionVector
Source§impl Default for VersionVector
impl Default for VersionVector
Source§fn default() -> VersionVector
fn default() -> VersionVector
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for VersionVector
impl<'de> Deserialize<'de> for VersionVector
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 PartialEq for VersionVector
impl PartialEq for VersionVector
Source§fn eq(&self, other: &VersionVector) -> bool
fn eq(&self, other: &VersionVector) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for VersionVector
impl Serialize for VersionVector
impl Eq for VersionVector
impl StructuralPartialEq for VersionVector
Auto Trait Implementations§
impl Freeze for VersionVector
impl RefUnwindSafe for VersionVector
impl Send for VersionVector
impl Sync for VersionVector
impl Unpin for VersionVector
impl UnsafeUnpin for VersionVector
impl UnwindSafe for VersionVector
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