[][src]Struct crdt_tree::logopmove::LogOpMove

pub struct LogOpMove<ID: TreeId, TM: TreeMeta, A: Actor> { /* fields omitted */ }

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]

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]

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]

fn from(l: LogOpMove<ID, TM, A>) -> Self[src]

creates OpMove from a LogOpMove

impl<ID: PartialEq + TreeId, TM: PartialEq + TreeMeta, A: PartialEq + Actor> PartialEq<LogOpMove<ID, TM, A>> for LogOpMove<ID, TM, A>[src]

impl<ID: TreeId, TM: TreeMeta, A: Actor> Serialize for LogOpMove<ID, TM, A> where
    ID: Serialize,
    TM: Serialize,
    A: Serialize
[src]

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

impl<ID, TM, A> Send for LogOpMove<ID, TM, A> where
    A: Send,
    ID: Send,
    TM: Send

impl<ID, TM, A> Sync for LogOpMove<ID, TM, A> where
    A: Sync,
    ID: Sync,
    TM: Sync

impl<ID, TM, A> Unpin for LogOpMove<ID, TM, A> where
    A: Unpin,
    ID: Unpin,
    TM: Unpin

impl<ID, TM, A> UnwindSafe for LogOpMove<ID, TM, A> where
    A: UnwindSafe,
    ID: UnwindSafe,
    TM: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<TM> TreeMeta for TM where
    TM: Clone
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,