pub struct Immutable<T> { /* private fields */ }Expand description
A write-once register that retains unequal concurrent initial values.
Implementations§
Source§impl<T> Immutable<T>
impl<T> Immutable<T>
Source§impl<T: Clone + Eq> Immutable<T>
impl<T: Clone + Eq> Immutable<T>
Sourcepub fn set(
&mut self,
value: T,
dot: Dot,
context: VersionVector,
) -> Result<(), CrdtError>
pub fn set( &mut self, value: T, dot: Dot, context: VersionVector, ) -> Result<(), CrdtError>
Sets an initial value, rejecting causal reassignment.
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 every concurrent initial value under commit-owned dots.
Trait Implementations§
Source§impl<T> FieldState for Immutable<T>
impl<T> FieldState for Immutable<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> Eq for Immutable<T>
impl<T> StructuralPartialEq for Immutable<T>
Auto Trait Implementations§
impl<T> Freeze for Immutable<T>
impl<T> RefUnwindSafe for Immutable<T>where
T: RefUnwindSafe,
impl<T> Send for Immutable<T>where
T: Send,
impl<T> Sync for Immutable<T>where
T: Sync,
impl<T> Unpin for Immutable<T>
impl<T> UnwindSafe for Immutable<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.