pub struct GSet<T: Eq + Hash + Clone> {
pub elements: HashSet<T>,
}Expand description
Grow-only Set (G-Set) CRDT.
Elements are typically event hashes (Strings) referencing comment content. The merge operation is a simple set union.
Satisfies semilattice properties:
- Commutative: a ∪ b = b ∪ a
- Associative: (a ∪ b) ∪ c = a ∪ (b ∪ c)
- Idempotent: a ∪ a = a
Fields§
§elements: HashSet<T>Implementations§
Trait Implementations§
Source§impl<'de, T> Deserialize<'de> for GSet<T>
impl<'de, T> Deserialize<'de> for GSet<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
impl<T: Eq + Eq + Hash + Clone> Eq for GSet<T>
impl<T: Eq + Hash + Clone> StructuralPartialEq for GSet<T>
Auto Trait Implementations§
impl<T> Freeze for GSet<T>
impl<T> RefUnwindSafe for GSet<T>where
T: RefUnwindSafe,
impl<T> Send for GSet<T>where
T: Send,
impl<T> Sync for GSet<T>where
T: Sync,
impl<T> Unpin for GSet<T>where
T: Unpin,
impl<T> UnsafeUnpin for GSet<T>
impl<T> UnwindSafe for GSet<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.