pub struct NodeRecord {
pub id: NodeId,
pub data: NodeData,
pub clock: VectorClock,
pub timestamp: DateTime<Utc>,
}Expand description
Metadata associated with a persisted node in the CRDT store.
Fields§
§id: NodeId§data: NodeData§clock: VectorClock§timestamp: DateTime<Utc>Implementations§
Source§impl NodeRecord
impl NodeRecord
Sourcepub fn new(id: NodeId, actor: impl Into<ActorId>, data: NodeData) -> Self
pub fn new(id: NodeId, actor: impl Into<ActorId>, data: NodeData) -> Self
Creates a new node record with a fresh logical clock entry for the actor.
Sourcepub fn merge_update(&mut self, actor: impl Into<ActorId>, data: NodeData)
pub fn merge_update(&mut self, actor: impl Into<ActorId>, data: NodeData)
Increments the logical clock for the given actor and updates the payload.
Trait Implementations§
Source§impl Clone for NodeRecord
impl Clone for NodeRecord
Source§fn clone(&self) -> NodeRecord
fn clone(&self) -> NodeRecord
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 NodeRecord
impl Debug for NodeRecord
Source§impl<'de> Deserialize<'de> for NodeRecord
impl<'de> Deserialize<'de> for NodeRecord
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 NodeRecord
impl PartialEq for NodeRecord
Source§impl Serialize for NodeRecord
impl Serialize for NodeRecord
impl StructuralPartialEq for NodeRecord
Auto Trait Implementations§
impl Freeze for NodeRecord
impl RefUnwindSafe for NodeRecord
impl Send for NodeRecord
impl Sync for NodeRecord
impl Unpin for NodeRecord
impl UnwindSafe for NodeRecord
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