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.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Change
impl !Send for Change
impl !Sync for Change
impl !UnwindSafe for Change
impl Freeze for Change
impl Unpin for Change
impl UnsafeUnpin for Change
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more