[−][src]Struct crdt_tree::logopmove::LogOpMove
From the paper:
In order to correctly apply move operations, a replica needs to maintain not only the current state of the tree, but also an operation log. The log is a list of LogMove records in descending timestamp order. LogMove t oldp p m c is similar to Move t p m c; the difference is that LogMove has an additional field oldp of type ('n x 'm) option. This option type means the field can either take the value None or a pair of a node ID and a metadata field.
When a replica applies a Move operation to its tree it also records a corresponding LogMove operation in its log. The t, p, m, and c fields are taken directly from the Move record while the oldp field is filled in based on the state of the tree before the move. If c did not exist in the tree, oldp is set to None. Else oldp records the previous parent metadata of c: if there exist p' and m' such that (p', m', c') E tree, then oldp is set to Some(p', m'). The get_parent() function implements this.
Implementations
impl<ID: TreeId, TM: TreeMeta, A: Actor> LogOpMove<ID, TM, A>
[src]
pub fn new(
op: OpMove<ID, TM, A>,
oldp: Option<TreeNode<ID, TM>>
) -> LogOpMove<ID, TM, A>
[src]
op: OpMove<ID, TM, A>,
oldp: Option<TreeNode<ID, TM>>
) -> LogOpMove<ID, TM, A>
create a new instance of LogOpMove
pub fn timestamp(&self) -> &Clock<A>
[src]
returns timestamp reference
pub fn parent_id(&self) -> &ID
[src]
returns parent_id reference
pub fn metadata(&self) -> &TM
[src]
returns metadata reference
pub fn child_id(&self) -> &ID
[src]
returns child_id reference
pub fn oldp(&self) -> &Option<TreeNode<ID, TM>>
[src]
returns oldp reference
pub fn op_into(self) -> OpMove<ID, TM, A>
[src]
converts LogOpMove into an OpMove
Trait Implementations
impl<ID: Clone + TreeId, TM: Clone + TreeMeta, A: Clone + Actor> Clone for LogOpMove<ID, TM, A>
[src]
impl<ID: Debug + TreeId, TM: Debug + TreeMeta, A: Debug + Actor> Debug for LogOpMove<ID, TM, A>
[src]
impl<'de, ID: TreeId, TM: TreeMeta, A: Actor> Deserialize<'de> for LogOpMove<ID, TM, A> where
ID: Deserialize<'de>,
TM: Deserialize<'de>,
A: Deserialize<'de>,
[src]
ID: Deserialize<'de>,
TM: Deserialize<'de>,
A: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<ID: Eq + TreeId, TM: Eq + TreeMeta, A: Eq + Actor> Eq for LogOpMove<ID, TM, A>
[src]
impl<ID: TreeId, A: Actor, TM: TreeMeta> From<LogOpMove<ID, TM, A>> for OpMove<ID, TM, A>
[src]
impl<ID: PartialEq + TreeId, TM: PartialEq + TreeMeta, A: PartialEq + Actor> PartialEq<LogOpMove<ID, TM, A>> for LogOpMove<ID, TM, A>
[src]
fn eq(&self, other: &LogOpMove<ID, TM, A>) -> bool
[src]
fn ne(&self, other: &LogOpMove<ID, TM, A>) -> bool
[src]
impl<ID: TreeId, TM: TreeMeta, A: Actor> Serialize for LogOpMove<ID, TM, A> where
ID: Serialize,
TM: Serialize,
A: Serialize,
[src]
ID: Serialize,
TM: Serialize,
A: Serialize,
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<ID: TreeId, TM: TreeMeta, A: Actor> StructuralEq for LogOpMove<ID, TM, A>
[src]
impl<ID: TreeId, TM: TreeMeta, A: Actor> StructuralPartialEq for LogOpMove<ID, TM, A>
[src]
Auto Trait Implementations
impl<ID, TM, A> RefUnwindSafe for LogOpMove<ID, TM, A> where
A: RefUnwindSafe,
ID: RefUnwindSafe,
TM: RefUnwindSafe,
A: RefUnwindSafe,
ID: RefUnwindSafe,
TM: RefUnwindSafe,
impl<ID, TM, A> Send for LogOpMove<ID, TM, A> where
A: Send,
ID: Send,
TM: Send,
A: Send,
ID: Send,
TM: Send,
impl<ID, TM, A> Sync for LogOpMove<ID, TM, A> where
A: Sync,
ID: Sync,
TM: Sync,
A: Sync,
ID: Sync,
TM: Sync,
impl<ID, TM, A> Unpin for LogOpMove<ID, TM, A> where
A: Unpin,
ID: Unpin,
TM: Unpin,
A: Unpin,
ID: Unpin,
TM: Unpin,
impl<ID, TM, A> UnwindSafe for LogOpMove<ID, TM, A> where
A: UnwindSafe,
ID: UnwindSafe,
TM: UnwindSafe,
A: UnwindSafe,
ID: UnwindSafe,
TM: 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,
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> 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<TM> TreeMeta for TM where
TM: Clone,
[src]
TM: Clone,
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<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,