pub trait EditorCommand:
Debug
+ Send
+ Sync {
// Required methods
fn name(&self) -> &str;
fn execute(&mut self, state: &mut EditorState);
fn undo(&mut self, state: &mut EditorState);
}Expand description
Trait that every undoable editor command must implement.
Required Methods§
Sourcefn execute(&mut self, state: &mut EditorState)
fn execute(&mut self, state: &mut EditorState)
Apply / re-apply the command.
Sourcefn undo(&mut self, state: &mut EditorState)
fn undo(&mut self, state: &mut EditorState)
Reverse the command.