[−][src]Struct crdts::ctx::ReadCtx
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
Methods
impl<V, A: Actor> 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
Trait Implementations
impl<V: Eq, A: Eq + Actor> Eq for ReadCtx<V, A>
[src]
impl<V: PartialEq, A: PartialEq + Actor> PartialEq<ReadCtx<V, A>> for ReadCtx<V, A>
[src]
impl<V: Clone, A: Clone + Actor> Clone for ReadCtx<V, A>
[src]
fn clone(&self) -> ReadCtx<V, A>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<V: Debug, A: Debug + Actor> Debug for ReadCtx<V, A>
[src]
impl<V, A: Actor> 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<'de, V, A: Actor> 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>,
Auto Trait Implementations
impl<V, A> Sync for ReadCtx<V, A> where
A: Sync,
V: Sync,
A: Sync,
V: Sync,
impl<V, A> Send for ReadCtx<V, A> where
A: Send,
V: Send,
A: Send,
V: Send,
impl<V, A> Unpin for ReadCtx<V, A> where
A: Unpin,
V: Unpin,
A: Unpin,
V: Unpin,
impl<V, A> RefUnwindSafe for ReadCtx<V, A> where
A: RefUnwindSafe,
V: RefUnwindSafe,
A: RefUnwindSafe,
V: RefUnwindSafe,
impl<V, A> UnwindSafe for ReadCtx<V, A> where
A: RefUnwindSafe + UnwindSafe,
V: UnwindSafe,
A: RefUnwindSafe + UnwindSafe,
V: UnwindSafe,
Blanket Implementations
impl<T> Val for T where
T: PartialEq<T> + Clone + Debug,
[src]
T: PartialEq<T> + Clone + Debug,
impl<T> Val for T where
T: Clone + Debug,
[src]
T: Clone + Debug,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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.
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,