pub struct ReadCtx<V, A: Ord> {
pub add_clock: VClock<A>,
pub rm_clock: VClock<A>,
pub val: V,
}
Expand description
ReadCtx’s are used to extract data from CRDT’s while maintaining some causal history. You should store ReadCtx’s close to where mutation is exposed to the user.
e.g. Ship ReadCtx to the clients, then derive an Add/RmCtx and ship that back to where the CRDT is stored to perform the mutation operation.
Fields§
§add_clock: VClock<A>
clock used to derive an AddCtx
rm_clock: VClock<A>
clock used to derive an RmCtx
val: V
the data read from the CRDT
Implementations§
Trait Implementations§
source§impl<'de, V, A> Deserialize<'de> for ReadCtx<V, A>where
V: Deserialize<'de>,
A: Deserialize<'de> + Ord,
impl<'de, V, A> Deserialize<'de> for ReadCtx<V, A>where V: Deserialize<'de>, A: Deserialize<'de> + Ord,
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<V: PartialEq, A: PartialEq + Ord> PartialEq<ReadCtx<V, A>> for ReadCtx<V, A>
impl<V: PartialEq, A: PartialEq + Ord> PartialEq<ReadCtx<V, A>> for ReadCtx<V, A>
impl<V: Eq, A: Eq + Ord> Eq for ReadCtx<V, A>
impl<V, A: Ord> StructuralEq for ReadCtx<V, A>
impl<V, A: Ord> StructuralPartialEq for ReadCtx<V, A>
Auto Trait Implementations§
impl<V, A> RefUnwindSafe for ReadCtx<V, A>where A: RefUnwindSafe, V: RefUnwindSafe,
impl<V, A> Send for ReadCtx<V, A>where A: Send, V: Send,
impl<V, A> Sync for ReadCtx<V, A>where A: Sync, V: Sync,
impl<V, A> Unpin for ReadCtx<V, A>where V: Unpin,
impl<V, A> UnwindSafe for ReadCtx<V, A>where A: RefUnwindSafe, V: 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