pub struct LWWRegister<T: Clone + Serialize> { /* private fields */ }Expand description
A register where the most recent write wins.
Implementations§
Source§impl<T: Clone + Serialize + for<'de> Deserialize<'de>> LWWRegister<T>
impl<T: Clone + Serialize + for<'de> Deserialize<'de>> LWWRegister<T>
Sourcepub fn with_value(value: T, node_id: &NodeId) -> Self
pub fn with_value(value: T, node_id: &NodeId) -> Self
Create a register with an initial value.
Sourcepub fn set_with_timestamp(&mut self, value: T, timestamp: u64, node_id: &NodeId)
pub fn set_with_timestamp(&mut self, value: T, timestamp: u64, node_id: &NodeId)
Set with a specific timestamp.
Trait Implementations§
Source§impl<T: Clone + Serialize + for<'de> Deserialize<'de>> CRDT for LWWRegister<T>
impl<T: Clone + Serialize + for<'de> Deserialize<'de>> CRDT for LWWRegister<T>
Source§impl<T: Clone + Clone + Serialize> Clone for LWWRegister<T>
impl<T: Clone + Clone + Serialize> Clone for LWWRegister<T>
Source§fn clone(&self) -> LWWRegister<T>
fn clone(&self) -> LWWRegister<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 + Serialize + for<'de> Deserialize<'de>> Default for LWWRegister<T>
impl<T: Clone + Serialize + for<'de> Deserialize<'de>> Default for LWWRegister<T>
Source§impl<'de, T> Deserialize<'de> for LWWRegister<T>
impl<'de, T> Deserialize<'de> for LWWRegister<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 LWWRegister<T>where
T: Freeze,
impl<T> RefUnwindSafe for LWWRegister<T>where
T: RefUnwindSafe,
impl<T> Send for LWWRegister<T>where
T: Send,
impl<T> Sync for LWWRegister<T>where
T: Sync,
impl<T> Unpin for LWWRegister<T>where
T: Unpin,
impl<T> UnsafeUnpin for LWWRegister<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for LWWRegister<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