pub struct ORSet<T, B: SetBias = AddWins> { /* private fields */ }Expand description
An observed-remove set with configurable bias.
Each element is tagged with dots (event identifiers). When removing, we record which dots we’ve seen. On merge, we compare dots to determine if adds/removes are concurrent or causal.
Implementations§
Source§impl<T: Hash + Eq + Clone, B: SetBias> ORSet<T, B>
impl<T: Hash + Eq + Clone, B: SetBias> ORSet<T, B>
Sourcepub fn new_random() -> Self
pub fn new_random() -> Self
Create a new set with a random replica ID.
Sourcepub fn remove(&mut self, value: &T)
pub fn remove(&mut self, value: &T)
Remove an element from the set.
This removes all dots associated with the element.
Sourcepub fn replica_id(&self) -> ReplicaId
pub fn replica_id(&self) -> ReplicaId
Get the replica ID for this set.
Trait Implementations§
Source§impl<T: Hash + Eq + Clone + Serialize + DeserializeOwned + Send + 'static, B: SetBias> DeltaCrdt for ORSet<T, B>
impl<T: Hash + Eq + Clone + Serialize + DeserializeOwned + Send + 'static, B: SetBias> DeltaCrdt for ORSet<T, B>
Source§impl<'de, T, B: SetBias> Deserialize<'de> for ORSet<T, B>
impl<'de, T, B: SetBias> Deserialize<'de> for ORSet<T, B>
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<T: Eq + Hash + Clone, B: SetBias> LogosContains<T> for ORSet<T, B>
impl<T: Eq + Hash + Clone, B: SetBias> LogosContains<T> for ORSet<T, B>
Source§fn logos_contains(&self, value: &T) -> bool
fn logos_contains(&self, value: &T) -> bool
Check if this collection contains the given value.
Auto Trait Implementations§
impl<T, B> Freeze for ORSet<T, B>
impl<T, B> RefUnwindSafe for ORSet<T, B>where
B: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, B> Send for ORSet<T, B>where
T: Send,
impl<T, B> Sync for ORSet<T, B>
impl<T, B> Unpin for ORSet<T, B>
impl<T, B> UnsafeUnpin for ORSet<T, B>
impl<T, B> UnwindSafe for ORSet<T, B>where
T: UnwindSafe,
B: 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