pub enum ListOp<T: Keyed> {
UpsertFront(T),
UpdateInPlace(T),
Remove(T::Key),
Clear,
}Expand description
A replayable mutation of a PersistedListModel’s backing list,
expressed by key so it can be applied to any starting Vec<T> —
in particular, the fresh one read off disk at flush time, which may
already include a peer process’s concurrent changes.
Variants§
UpsertFront(T)
Remove any existing entry with this item’s key, then insert T at
the front. This is the “most recently used” operation: re-running
it against any starting vector — including one a peer has already
mutated — reproduces the same dedupe-and-promote-to-front
invariant MruList::add relies on.
UpdateInPlace(T)
Replace the entry with this item’s key in place (no reordering). A no-op if the key is no longer present — e.g. a peer concurrently removed it, in which case that removal wins.
Remove(T::Key)
Remove the entry with this key, if present. No-op otherwise.
Clear
Drop every entry.