pub enum Edit {
Remove(Range<usize>),
Insert(Range<usize>),
Move {
from: usize,
to: usize,
},
Update(Range<usize>),
}Expand description
One step of a CollectionChange.
Indices follow batch-update semantics, the model UIKit’s
performBatchUpdates and diffable data sources use: removals and the
source of a move name positions in the previous snapshot; insertions,
updates and the destination of a move name positions in the new
snapshot. Edits are not applied one after another; every index refers to
one of the two snapshots as a whole.
Variants§
Remove(Range<usize>)
The items at this range of the previous snapshot no longer exist.
Insert(Range<usize>)
The items at this range of the new snapshot did not exist before.
Move
The item at from in the previous snapshot is now at to in the new
snapshot, and its order relative to the other surviving items changed.
Items that only shift because of insertions or removals around them are not reported as moves.
Update(Range<usize>)
The items at this range of the new snapshot kept their identity but their content may differ.
An item can be both moved and updated; it then appears in a
Edit::Move and in an Edit::Update covering its new position.