pub struct VersionVector { /* private fields */ }Expand description
Version vector for causal ordering (not total ordering)
Implementations§
Source§impl VersionVector
impl VersionVector
pub fn new() -> Self
pub fn happens_before(&self, other: &VersionVector) -> bool
Sourcepub fn concurrent(&self, other: &VersionVector) -> bool
pub fn concurrent(&self, other: &VersionVector) -> bool
Check if two version vectors are concurrent (neither happens-before)
Sourcepub fn merge(&self, other: &VersionVector) -> VersionVector
pub fn merge(&self, other: &VersionVector) -> VersionVector
Merge two version vectors (element-wise max)
Sourcepub fn to_compact(&self) -> Vec<(NodeId, u64)>
pub fn to_compact(&self) -> Vec<(NodeId, u64)>
Compact representation for wire format
Sourcepub fn from_compact(entries: Vec<(NodeId, u64)>) -> Self
pub fn from_compact(entries: Vec<(NodeId, u64)>) -> Self
Restore from compact representation
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 · 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 PartialEq for VersionVector
impl PartialEq 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 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