pub struct DotContext { /* private fields */ }Expand description
Tracks which events have been seen in the system.
The DotContext maintains a VClock for contiguous sequences and a “cloud” set for dots that arrive out of order. When gaps are filled, dots are compacted from the cloud into the clock.
Implementations§
Source§impl DotContext
impl DotContext
Sourcepub fn next(&mut self, replica: ReplicaId) -> Dot
pub fn next(&mut self, replica: ReplicaId) -> Dot
Generate the next dot for a replica and mark it as seen.
Sourcepub fn has_seen(&self, dot: &Dot) -> bool
pub fn has_seen(&self, dot: &Dot) -> bool
Check if a dot has been seen (either in clock or cloud).
Trait Implementations§
Source§impl Clone for DotContext
impl Clone for DotContext
Source§fn clone(&self) -> DotContext
fn clone(&self) -> DotContext
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 DotContext
impl Debug for DotContext
Source§impl Default for DotContext
impl Default for DotContext
Source§fn default() -> DotContext
fn default() -> DotContext
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for DotContext
impl<'de> Deserialize<'de> for DotContext
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 DotContext
impl PartialEq for DotContext
Source§impl Serialize for DotContext
impl Serialize for DotContext
impl Eq for DotContext
impl StructuralPartialEq for DotContext
Auto Trait Implementations§
impl Freeze for DotContext
impl RefUnwindSafe for DotContext
impl Send for DotContext
impl Sync for DotContext
impl Unpin for DotContext
impl UnsafeUnpin for DotContext
impl UnwindSafe for DotContext
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