pub enum SetOp<T> {
Add {
id: OpId,
value: T,
},
Remove {
id: OpId,
value: T,
tags: Vec<OpId>,
},
}Expand description
A single Set CRDT operation.
Variants§
Add
Add value with a unique tag (this op’s id).
Remove
Remove value, dropping the listed tags.
tags is exactly the set of add-tags this replica observed for value
at the moment of removal. Concurrent adds (whose tags aren’t in this
list) survive — that’s the “add wins” rule.
Implementations§
Trait Implementations§
Source§impl<'de, T> Deserialize<'de> for SetOp<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for SetOp<T>where
T: Deserialize<'de>,
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
impl<T: Eq> Eq for SetOp<T>
impl<T> StructuralPartialEq for SetOp<T>
Auto Trait Implementations§
impl<T> Freeze for SetOp<T>where
T: Freeze,
impl<T> RefUnwindSafe for SetOp<T>where
T: RefUnwindSafe,
impl<T> Send for SetOp<T>where
T: Send,
impl<T> Sync for SetOp<T>where
T: Sync,
impl<T> Unpin for SetOp<T>where
T: Unpin,
impl<T> UnsafeUnpin for SetOp<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for SetOp<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