pub struct MVRegister<T: Clone + Eq + Hash + Serialize> { /* private fields */ }Expand description
A register that keeps all concurrent values.
Implementations§
Source§impl<T: Clone + Eq + Hash + Serialize + for<'de> Deserialize<'de>> MVRegister<T>
impl<T: Clone + Eq + Hash + Serialize + for<'de> Deserialize<'de>> MVRegister<T>
Sourcepub fn set(&mut self, value: T, clock: VectorClock)
pub fn set(&mut self, value: T, clock: VectorClock)
Set the register value.
Sourcepub fn get_with_clocks(&self) -> Vec<(&T, &VectorClock)>
pub fn get_with_clocks(&self) -> Vec<(&T, &VectorClock)>
Get values with their clocks.
Sourcepub fn has_conflict(&self) -> bool
pub fn has_conflict(&self) -> bool
Check if there are concurrent values (conflict).
Sourcepub fn value_count(&self) -> usize
pub fn value_count(&self) -> usize
Get the number of concurrent values.
Trait Implementations§
Source§impl<T: Clone + Eq + Hash + Serialize + for<'de> Deserialize<'de>> CRDT for MVRegister<T>
impl<T: Clone + Eq + Hash + Serialize + for<'de> Deserialize<'de>> CRDT for MVRegister<T>
Source§impl<T: Clone + Clone + Eq + Hash + Serialize> Clone for MVRegister<T>
impl<T: Clone + Clone + Eq + Hash + Serialize> Clone for MVRegister<T>
Source§fn clone(&self) -> MVRegister<T>
fn clone(&self) -> MVRegister<T>
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<T: Clone + Eq + Hash + Serialize + for<'de> Deserialize<'de>> Default for MVRegister<T>
impl<T: Clone + Eq + Hash + Serialize + for<'de> Deserialize<'de>> Default for MVRegister<T>
Source§impl<'de, T> Deserialize<'de> for MVRegister<T>
impl<'de, T> Deserialize<'de> for MVRegister<T>
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
Auto Trait Implementations§
impl<T> Freeze for MVRegister<T>
impl<T> RefUnwindSafe for MVRegister<T>where
T: RefUnwindSafe,
impl<T> Send for MVRegister<T>where
T: Send,
impl<T> Sync for MVRegister<T>where
T: Sync,
impl<T> Unpin for MVRegister<T>where
T: Unpin,
impl<T> UnsafeUnpin for MVRegister<T>
impl<T> UnwindSafe for MVRegister<T>where
T: UnwindSafe,
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