pub enum Op {
Equal {
a: usize,
b: usize,
},
Delete {
a: usize,
},
Insert {
b: usize,
},
Move {
a: usize,
b: usize,
},
Replace {
a: Range<usize>,
b: Range<usize>,
},
}Expand description
One step of an edit script.
Scripts list ops in output order: the b indices of Equal, Insert, Move and
Replace ops appear in increasing order, so walking the script reconstructs b.
Delete ops sit at their position relative to the surviving a items.
Variants§
Equal
a[a] is kept and becomes b[b].
Delete
a[a] is removed.
Insert
b[b] is new.
Move
a[a] and b[b] have equal keys but were not matched in order: the item travels.
Replace
The items a[a] are replaced by (morphed into) the items b[b].
Trait Implementations§
impl Eq for Op
impl StructuralPartialEq for Op
Auto Trait Implementations§
impl Freeze for Op
impl RefUnwindSafe for Op
impl Send for Op
impl Sync for Op
impl Unpin for Op
impl UnsafeUnpin for Op
impl UnwindSafe for Op
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