pub struct UndoStack { /* private fields */ }Expand description
A stack of reversible commands with reactive can_undo/can_redo state
and a change stream.
Implementations§
Source§impl UndoStack
impl UndoStack
Sourcepub fn push(&self, command: Box<dyn Command>)
pub fn push(&self, command: Box<dyn Command>)
Execute command and push it onto the undo stack, clearing redo.
Sourcepub fn redo(&self) -> bool
pub fn redo(&self) -> bool
Redo the most recently undone command; returns whether anything was redone.
Sourcepub fn changed(&self) -> EventStream<()>
pub fn changed(&self) -> EventStream<()>
A stream of events after every push, undo, redo, or clear.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for UndoStack
impl !RefUnwindSafe for UndoStack
impl !Send for UndoStack
impl !Sync for UndoStack
impl !UnwindSafe for UndoStack
impl Unpin for UndoStack
impl UnsafeUnpin for UndoStack
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