Type Alias loro_internal::event::ListDiffItem
source · pub type ListDiffItem = DeltaItem<ListDiffInsertItem, ListDeltaMeta>;
Aliased Type§
enum ListDiffItem {
Retain {
len: usize,
attr: ListDeltaMeta,
},
Replace {
value: ArrayVec<ValueOrHandler, 8>,
attr: ListDeltaMeta,
delete: usize,
},
}
Variants§
Retain
Replace
This is the combined of a delete and an insert.
They are two separate operations in the original Quill Delta format. But the order of two neighboring delete and insert operations can be swapped without changing the result. So Quill requires that the insert always comes before the delete. So it creates room for invalid deltas by the type system. Using Replace is a way to avoid this.