pub struct Change {
pub components: Vec<u64>,
pub label: &'static str,
pub op: Op,
pub prior: Option<Rc<dyn Any>>,
pub value: Option<Rc<dyn Any>>,
pub author: Option<&'static str>,
}Expand description
One announced change, in the form a store outside the UI can consume.
prior and value are the slot’s value before and after the write, captured only while a
consumer that wants them is active (record_values, an UndoStack). A write with no such
consumer clones nothing. They are type-erased; downcast with Change::prior_as /
Change::value_as. A structural change carries positions as well: a Delete has the
removed row in prior and its index (usize) in value, an Insert the added row in
value and its index in prior, and a Move its index before and after.
Fields§
§components: Vec<u64>The path’s components, outermost first: store, key, field, …
label: &'static strThe field’s name, which is also its column name.
op: Op§prior: Option<Rc<dyn Any>>§value: Option<Rc<dyn Any>>Who made it: None is the user; an undo replay stamps “undo”/“redo”; an importer its
own name (with_author). Consumers can decline their own echoes.