pub struct VersionVector { /* private fields */ }Implementations§
Source§impl VersionVector
impl VersionVector
pub fn new() -> Self
pub fn increment(&mut self, node: &str) -> u64
pub fn get(&self, node: &str) -> u64
pub fn set(&mut self, node: &str, version: u64)
Sourcepub fn compare(&self, other: &VersionVector) -> VersionOrder
pub fn compare(&self, other: &VersionVector) -> VersionOrder
Compare two version vectors: +1 if self dominates, -1 if other dominates, 0 if concurrent.
Sourcepub fn merge(&mut self, other: &VersionVector)
pub fn merge(&mut self, other: &VersionVector)
Merge: take component-wise max.
pub fn is_empty(&self) -> bool
pub fn node_count(&self) -> usize
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
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