Trait rundo_types::Rundo
[−]
[src]
pub trait Rundo { type Op: Debug; fn dirty(&self) -> bool; fn change_op(&mut self) -> Option<Self::Op>; fn reset(&mut self); fn back(&mut self, op: &Self::Op); fn forward(&mut self, op: &Self::Op); }
Every rundo node must implement Rundo trait to support undo/redo. In most of case, you can derive Rundo, of course, you can implement it by yourself.
Associated Types
Required Methods
fn dirty(&self) -> bool
if this node has been changed between from the last step to current.
fn change_op(&mut self) -> Option<Self::Op>
Use Op to describe the change infos.
fn reset(&mut self)
Reset the node change state which mean changes has been record by workspace, or changes will be ignore.
fn back(&mut self, op: &Self::Op)
Use an Op and back to the previous data status
fn forward(&mut self, op: &Self::Op)
Go to the next version of the data should be with a Op.