pub struct VectorClock { /* private fields */ }Implementations§
Source§impl VectorClock
impl VectorClock
pub fn new() -> Self
pub fn from_json(json: &str) -> Result<Self>
pub fn to_json(&self) -> Result<String>
pub fn get(&self, instance_id: &str) -> i64
pub fn set(&mut self, instance_id: String, version: i64)
pub fn increment(&mut self, instance_id: &str) -> i64
pub fn merge(&mut self, other: &VectorClock)
pub fn compare(&self, other: &VectorClock) -> ClockOrder
pub fn happens_before(&self, other: &VectorClock) -> bool
pub fn is_concurrent(&self, other: &VectorClock) -> bool
pub fn is_equal(&self, other: &VectorClock) -> bool
pub fn instances(&self) -> Vec<String>
pub fn instance_count(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn clear(&mut self)
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§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§impl<'de> Deserialize<'de> for VectorClock
impl<'de> Deserialize<'de> for VectorClock
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 Display for VectorClock
impl Display for VectorClock
Source§impl PartialEq for VectorClock
impl PartialEq for VectorClock
Source§impl Serialize for VectorClock
impl Serialize for VectorClock
impl Eq for VectorClock
impl StructuralPartialEq for VectorClock
Auto Trait Implementations§
impl Freeze for VectorClock
impl RefUnwindSafe for VectorClock
impl Send for VectorClock
impl Sync for VectorClock
impl Unpin for VectorClock
impl UnwindSafe for VectorClock
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)