pub enum ChangeKind<P: Primitive> {
Added(P),
NodeAdded(Node<P>),
Removed(P),
NodeRemoved(Node<P>),
Modified(P, P),
SequenceChange(Vec<Edit<Node<P>>>),
}Expand description
Represents a change in a possibly recursive structure.
Added, Removed, Modified are actions on leaves.
NodeAdded, NodeRemoved are actions on nodes.
SequenceChange contains the raw Myers edit script for a sequence.
§Note
We don’t diff recursively inside lists as Rust lacks facilities
to dispatch between Vec<Primitive> and Vec<Node<Primitive>>.
For this reason we always apply Myers.
Variants§
Added(P)
NodeAdded(Node<P>)
Removed(P)
NodeRemoved(Node<P>)
Modified(P, P)
SequenceChange(Vec<Edit<Node<P>>>)
Trait Implementations§
Source§impl<P: Clone + Primitive> Clone for ChangeKind<P>
impl<P: Clone + Primitive> Clone for ChangeKind<P>
Source§fn clone(&self) -> ChangeKind<P>
fn clone(&self) -> ChangeKind<P>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<P: Eq + Primitive> Eq for ChangeKind<P>
impl<P: Primitive> StructuralPartialEq for ChangeKind<P>
Auto Trait Implementations§
impl<P> Freeze for ChangeKind<P>where
P: Freeze,
impl<P> RefUnwindSafe for ChangeKind<P>where
P: RefUnwindSafe,
impl<P> Send for ChangeKind<P>where
P: Send,
impl<P> Sync for ChangeKind<P>where
P: Sync,
impl<P> Unpin for ChangeKind<P>where
P: Unpin,
impl<P> UnsafeUnpin for ChangeKind<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for ChangeKind<P>where
P: 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