pub struct CompositeCommand {
pub stack_id: u64,
/* private fields */
}Expand description
A composite command that groups multiple commands as one.
This allows treating a sequence of commands as a single unit for undo/redo operations. When a composite command is undone or redone, all its contained commands are undone or redone in the appropriate order.
§Example
use common::undo_redo::CompositeCommand;
let mut composite = CompositeCommand::new();
composite.add_command(Box::new(Command1::new()));
composite.add_command(Box::new(Command2::new()));
// Now composite can be treated as a single commandFields§
§stack_id: u64Implementations§
Source§impl CompositeCommand
impl CompositeCommand
Sourcepub fn add_command(&mut self, command: Box<dyn UndoRedoCommand>)
pub fn add_command(&mut self, command: Box<dyn UndoRedoCommand>)
Adds a command to this composite.
Commands are executed, undone, and redone in the order they are added.
Trait Implementations§
Source§impl UndoRedoCommand for CompositeCommand
impl UndoRedoCommand for CompositeCommand
Auto Trait Implementations§
impl Freeze for CompositeCommand
impl !RefUnwindSafe for CompositeCommand
impl Send for CompositeCommand
impl !Sync for CompositeCommand
impl Unpin for CompositeCommand
impl UnsafeUnpin for CompositeCommand
impl !UnwindSafe for CompositeCommand
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
Mutably borrows from an owned value. Read more