pub struct LogOpMove<ID: TreeId, TM: TreeMeta, A: Actor> { /* private fields */ }Expand description
Implements LogOpMove, a log entry used by State
§From the paper[1]:
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§
Trait Implementations§
Source§impl<ID: Clone + TreeId, TM: Clone + TreeMeta, A: Clone + Actor> Clone for LogOpMove<ID, TM, A>
impl<ID: Clone + TreeId, TM: Clone + TreeMeta, A: Clone + Actor> Clone for LogOpMove<ID, TM, A>
Source§impl<ID: Debug + TreeId, TM: Debug + TreeMeta, A: Debug + Actor> Debug for LogOpMove<ID, TM, A>
impl<ID: Debug + TreeId, TM: Debug + TreeMeta, A: Debug + Actor> Debug for LogOpMove<ID, TM, A>
Source§impl<'de, ID, TM, A> Deserialize<'de> for LogOpMove<ID, TM, A>
impl<'de, ID, TM, A> Deserialize<'de> for LogOpMove<ID, TM, A>
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<ID: PartialEq + TreeId, TM: PartialEq + TreeMeta, A: PartialEq + Actor> PartialEq for LogOpMove<ID, TM, A>
impl<ID: PartialEq + TreeId, TM: PartialEq + TreeMeta, A: PartialEq + Actor> PartialEq for LogOpMove<ID, TM, A>
impl<ID: Eq + TreeId, TM: Eq + TreeMeta, A: Eq + Actor> Eq for LogOpMove<ID, TM, A>
impl<ID: TreeId, TM: TreeMeta, A: Actor> StructuralPartialEq for LogOpMove<ID, TM, A>
Auto Trait Implementations§
impl<ID, TM, A> Freeze for LogOpMove<ID, TM, A>
impl<ID, TM, A> RefUnwindSafe for LogOpMove<ID, TM, A>
impl<ID, TM, A> Send for LogOpMove<ID, TM, A>
impl<ID, TM, A> Sync for LogOpMove<ID, TM, A>
impl<ID, TM, A> Unpin for LogOpMove<ID, TM, A>
impl<ID, TM, A> UnwindSafe for LogOpMove<ID, TM, A>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more