pub struct VectorClock { /* private fields */ }Expand description
Vector Clock — tracks the last operation seen from each actor. Used for: causal consistency, delta sync, GC.
Implementations§
Source§impl VectorClock
impl VectorClock
pub fn new() -> Self
pub fn get(&self, actor: ActorId) -> u64
pub fn advance(&mut self, actor: ActorId, ts: u64)
Sourcepub fn dominates(&self, other: &VectorClock) -> bool
pub fn dominates(&self, other: &VectorClock) -> bool
Returns true if self has seen everything other has seen.
Sourcepub fn merge(&mut self, other: &VectorClock)
pub fn merge(&mut self, other: &VectorClock)
Point-wise merge: take max of each component.
Trait Implementations§
Source§impl Clone for VectorClock
impl Clone for VectorClock
Source§fn clone(&self) -> VectorClock
fn clone(&self) -> VectorClock
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 VectorClock
impl Debug for VectorClock
Source§impl Default for VectorClock
impl Default for VectorClock
Source§fn default() -> VectorClock
fn default() -> VectorClock
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for VectorClock
impl RefUnwindSafe for VectorClock
impl Send for VectorClock
impl Sync for VectorClock
impl Unpin for VectorClock
impl UnsafeUnpin for VectorClock
impl UnwindSafe for VectorClock
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