pub struct ORSet<V: Ord + Clone> { /* private fields */ }Expand description
Observed-remove set.
Each addition is tagged with a unique (node, sequence) pair. Removal only deletes the tags observed at remove time, so concurrent adds of the same element survive removal.
Implementations§
Source§impl<V: Ord + Clone> ORSet<V>
impl<V: Ord + Clone> ORSet<V>
Sourcepub fn add(&mut self, value: V, node: &NodeId)
pub fn add(&mut self, value: V, node: &NodeId)
Adds a value, tagging the addition with the given node.
Sourcepub fn remove(&mut self, value: &V)
pub fn remove(&mut self, value: &V)
Removes a value by clearing all currently observed tags.
Concurrent adds (with tags not yet observed) will survive.
Sourcepub fn contains(&self, value: &V) -> bool
pub fn contains(&self, value: &V) -> bool
Returns true if the value is present (has at least one live tag).
Trait Implementations§
impl<V: Eq + Ord + Clone> Eq for ORSet<V>
impl<V: Ord + Clone> StructuralPartialEq for ORSet<V>
Auto Trait Implementations§
impl<V> Freeze for ORSet<V>
impl<V> RefUnwindSafe for ORSet<V>where
V: RefUnwindSafe,
impl<V> Send for ORSet<V>where
V: Send,
impl<V> Sync for ORSet<V>where
V: Sync,
impl<V> Unpin for ORSet<V>
impl<V> UnsafeUnpin for ORSet<V>
impl<V> UnwindSafe for ORSet<V>where
V: RefUnwindSafe,
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).