Struct crdts::ctx::ReadCtx [−][src]
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
impl<V, A: Ord + Clone + Debug> ReadCtx<V, A>
[src]
pub fn derive_add_ctx(self, actor: A) -> AddCtx<A>
[src]
Derives an AddCtx for a given actor from a ReadCtx
pub fn derive_rm_ctx(self) -> RmCtx<A>
[src]
Derives a RmCtx from a ReadCtx
pub fn split(self) -> (V, ReadCtx<(), A>)
[src]
Splits this ReadCtx into its data and an empty ReadCtx
Trait Implementations
impl<V: Debug, A: Debug + Ord> Debug for ReadCtx<V, A>
[src]
impl<'de, V, A: Ord> Deserialize<'de> for ReadCtx<V, A> where
V: Deserialize<'de>,
A: Deserialize<'de>,
[src]
V: Deserialize<'de>,
A: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<V: Eq, A: Eq + Ord> Eq for ReadCtx<V, A>
[src]
impl<V: PartialEq, A: PartialEq + Ord> PartialEq<ReadCtx<V, A>> for ReadCtx<V, A>
[src]
impl<V, A: Ord> Serialize for ReadCtx<V, A> where
V: Serialize,
A: Serialize,
[src]
V: Serialize,
A: Serialize,
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<V, A: Ord> StructuralEq for ReadCtx<V, A>
[src]
impl<V, A: Ord> StructuralPartialEq for ReadCtx<V, A>
[src]
Auto Trait Implementations
impl<V, A> RefUnwindSafe for ReadCtx<V, A> where
A: RefUnwindSafe,
V: RefUnwindSafe,
A: RefUnwindSafe,
V: RefUnwindSafe,
impl<V, A> Send for ReadCtx<V, A> where
A: Send,
V: Send,
A: Send,
V: Send,
impl<V, A> Sync for ReadCtx<V, A> where
A: Sync,
V: Sync,
A: Sync,
V: Sync,
impl<V, A> Unpin for ReadCtx<V, A> where
V: Unpin,
V: Unpin,
impl<V, A> UnwindSafe for ReadCtx<V, A> where
A: RefUnwindSafe,
V: UnwindSafe,
A: RefUnwindSafe,
V: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,