pub struct Lww<T> { /* private fields */ }Expand description
A causal last-writer-wins register that never uses wall-clock time.
Implementations§
Source§impl<T> Lww<T>
impl<T> Lww<T>
Source§impl<T> Lww<T>
impl<T> Lww<T>
Sourcepub fn assign(
&mut self,
value: T,
dot: Dot,
context: VersionVector,
) -> Result<(), CrdtError>
pub fn assign( &mut self, value: T, dot: Dot, context: VersionVector, ) -> Result<(), CrdtError>
Applies an assignment using causal order, then dot order for concurrency.
Sourcepub fn merge(&mut self, other: &Lww<T>) -> Result<(), CrdtError>
pub fn merge(&mut self, other: &Lww<T>) -> 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<Lww<T>, CrdtError>
pub fn canonicalize_for_commit( &self, author: AuthorId, sequence: u64, context: &VersionVector, next_operation: &mut u32, ) -> Result<Lww<T>, CrdtError>
Reissues causal metadata from an authenticated commit while preserving the value.
Trait Implementations§
Source§impl<T> FieldState for Lww<T>
impl<T> FieldState for Lww<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<Lww<T>, RecordError>
fn decode_state(bytes: &[u8]) -> Result<Lww<T>, 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: &Lww<T>) -> Result<(), RecordError>
fn merge_state(&mut self, other: &Lww<T>) -> 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<Lww<T>, RecordError>
fn canonicalize_for_commit( &self, author: AuthorId, sequence: u64, context: &VersionVector, next_operation: &mut u32, ) -> Result<Lww<T>, 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 for Lww<T>where
T: Eq,
impl<T> StructuralPartialEq for Lww<T>
Auto Trait Implementations§
impl<T> Freeze for Lww<T>where
T: Freeze,
impl<T> RefUnwindSafe for Lww<T>where
T: RefUnwindSafe,
impl<T> Send for Lww<T>where
T: Send,
impl<T> Sync for Lww<T>where
T: Sync,
impl<T> Unpin for Lww<T>where
T: Unpin,
impl<T> UnwindSafe for Lww<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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
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.