pub enum DiffOp {
Insert {
index: usize,
node: VirtualNode,
},
Remove {
index: usize,
},
Move {
from: usize,
to: usize,
},
Update {
index: usize,
},
}Expand description
A single diff operation that transforms one virtual- DOM list into another.
Operations are emitted in the order they should be applied. Indices refer to positions in the current list (after prior ops have been applied).
Variants§
Insert
Insert a new node at the given index. The index is the position in the new list.
Remove
Remove the node at the given index from the old list.
Move
Move the node currently at from to to.
Update
Patch the node at the given index in place (both old and new lists reference the same node, so the index is the same in both).
Trait Implementations§
impl StructuralPartialEq for DiffOp
Auto Trait Implementations§
impl !RefUnwindSafe for DiffOp
impl !Send for DiffOp
impl !Sync for DiffOp
impl !UnwindSafe for DiffOp
impl Freeze for DiffOp
impl Unpin for DiffOp
impl UnsafeUnpin for DiffOp
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