pub struct OrSet<T: Ord> { /* private fields */ }Expand description
An add-wins observed-remove set.
Implementations§
Source§impl<T: Clone + Ord> OrSet<T>
impl<T: Clone + Ord> OrSet<T>
Sourcepub fn insert(&mut self, value: T, dot: Dot) -> Result<(), CrdtError>
pub fn insert(&mut self, value: T, dot: Dot) -> Result<(), CrdtError>
Adds a value under a globally unique operation dot.
Sourcepub fn remove(&mut self, value: &T, context: &VersionVector)
pub fn remove(&mut self, value: &T, context: &VersionVector)
Removes only add operations visible in context.
Sourcepub fn merge(&mut self, other: &Self) -> Result<(), CrdtError>
pub fn merge(&mut self, other: &Self) -> Result<(), CrdtError>
Deterministically combines another replica’s state.
Sourcepub fn canonicalize_for_commit(
&self,
author: AuthorId,
sequence: u64,
_context: &VersionVector,
next_operation: &mut u32,
) -> Result<Self, CrdtError>
pub fn canonicalize_for_commit( &self, author: AuthorId, sequence: u64, _context: &VersionVector, next_operation: &mut u32, ) -> Result<Self, CrdtError>
Reissues live additions under commit-owned dots and drops superseded tombstones.
Trait Implementations§
Source§impl<T> FieldState for OrSet<T>
impl<T> FieldState for OrSet<T>
Source§fn encode_state(&self) -> Result<Vec<u8>, RecordError>
fn encode_state(&self) -> Result<Vec<u8>, RecordError>
Encodes complete causal field state.
Source§fn decode_state(bytes: &[u8]) -> Result<Self, RecordError>
fn decode_state(bytes: &[u8]) -> Result<Self, RecordError>
Strictly decodes complete causal field state.
Source§fn visible_values(&self) -> Result<Vec<Vec<u8>>, RecordError>
fn visible_values(&self) -> Result<Vec<Vec<u8>>, RecordError>
Encodes each currently visible application value for filtering and indexes.
Source§fn merge_state(&mut self, other: &Self) -> Result<(), RecordError>
fn merge_state(&mut self, other: &Self) -> Result<(), RecordError>
Deterministically merges complete causal state from another replica.
Source§fn canonicalize_for_commit(
&self,
author: AuthorId,
sequence: u64,
context: &VersionVector,
next_operation: &mut u32,
) -> Result<Self, RecordError>
fn canonicalize_for_commit( &self, author: AuthorId, sequence: u64, context: &VersionVector, next_operation: &mut u32, ) -> Result<Self, RecordError>
Reissues all causal identities from one authenticated commit envelope.
Source§fn value_type_name() -> &'static str
fn value_type_name() -> &'static str
Stable Rust logical value type used in schema compatibility checks.
impl<T: Eq + Ord> Eq for OrSet<T>
impl<T: Ord> StructuralPartialEq for OrSet<T>
Auto Trait Implementations§
impl<T> Freeze for OrSet<T>
impl<T> RefUnwindSafe for OrSet<T>where
T: RefUnwindSafe,
impl<T> Send for OrSet<T>where
T: Send,
impl<T> Sync for OrSet<T>where
T: Sync,
impl<T> Unpin for OrSet<T>
impl<T> UnwindSafe for OrSet<T>where
T: 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> RecordKey for T
impl<T> RecordKey for T
Source§fn encode_key(&self) -> Result<Vec<u8>, RecordError>
fn encode_key(&self) -> Result<Vec<u8>, RecordError>
Encodes this key into its unique durable representation.
Source§fn decode_key(bytes: &[u8]) -> Result<T, RecordError>
fn decode_key(bytes: &[u8]) -> Result<T, RecordError>
Strictly decodes a key from its unique durable representation.