pub struct Transition<T>where
T: LinkReference,{
pub transaction_id: u64,
pub sequence: u64,
pub kind: TransitionKind,
pub before: Link<T>,
pub after: Link<T>,
}Expand description
A reversible mutation, including both link states.
Fields§
§transaction_id: u64Journal-local transaction identifier.
sequence: u64Journal-local, monotonically increasing write sequence.
kind: TransitionKindThe kind of mutation.
before: Link<T>Link state before mutation; the null link for creation.
after: Link<T>Link state after mutation; the null link for deletion.
Implementations§
Source§impl<T> Transition<T>where
T: LinkReference,
impl<T> Transition<T>where
T: LinkReference,
Sourcepub fn new(
transaction_id: u64,
sequence: u64,
before: Link<T>,
after: Link<T>,
) -> Transition<T>
pub fn new( transaction_id: u64, sequence: u64, before: Link<T>, after: Link<T>, ) -> Transition<T>
Constructs a transition, inferring its kind from the null side.
Sourcepub fn apply<L>(&self, links: &mut L) -> Result<(), Error<T>>where
L: Doublets<T>,
pub fn apply<L>(&self, links: &mut L) -> Result<(), Error<T>>where
L: Doublets<T>,
Applies this write without generating another journal record.
Repeated application is harmless. The store must support raw writes and exact-address restoration through sequential allocation (as both supplied stores do). This reconstructs the graph with O(number of links + highest address) store operations, plus sorting and backend index costs.
Trait Implementations§
Source§impl<T> Clone for Transition<T>where
T: Clone + LinkReference,
impl<T> Clone for Transition<T>where
T: Clone + LinkReference,
Source§fn clone(&self) -> Transition<T>
fn clone(&self) -> Transition<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T> Debug for Transition<T>where
T: Debug + LinkReference,
impl<T> Debug for Transition<T>where
T: Debug + LinkReference,
impl<T> Eq for Transition<T>where
T: Eq + LinkReference,
Source§impl<T> PartialEq for Transition<T>where
T: PartialEq + LinkReference,
impl<T> PartialEq for Transition<T>where
T: PartialEq + LinkReference,
impl<T> StructuralPartialEq for Transition<T>where
T: PartialEq + LinkReference,
Auto Trait Implementations§
impl<T> Forget for Transition<T>
impl<T> Freeze for Transition<T>
impl<T> RefUnwindSafe for Transition<T>where
Link<T>: RefUnwindSafe,
impl<T> Send for Transition<T>
impl<T> Sync for Transition<T>
impl<T> Unpin for Transition<T>
impl<T> UnsafeUnpin for Transition<T>where
Link<T>: UnsafeUnpin,
impl<T> UnwindSafe for Transition<T>where
Link<T>: UnwindSafe,
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