pub struct UndoStack<T: Clone> { /* private fields */ }Expand description
Implementations§
Source§impl<T: Clone> UndoStack<T>
impl<T: Clone> UndoStack<T>
Sourcepub fn push(&mut self, item: T)
pub fn push(&mut self, item: T)
Push a new state snapshot onto the stack.
Any redo history after the current position is discarded.
Sourcepub fn undo(&mut self) -> Option<&T>
pub fn undo(&mut self) -> Option<&T>
Move one step backward in history and return the state at the new position.
If already at the earliest state, returns that state again.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for UndoStack<T>
impl<T> RefUnwindSafe for UndoStack<T>where
T: RefUnwindSafe,
impl<T> Send for UndoStack<T>where
T: Send,
impl<T> Sync for UndoStack<T>where
T: Sync,
impl<T> Unpin for UndoStack<T>where
T: Unpin,
impl<T> UnsafeUnpin for UndoStack<T>
impl<T> UnwindSafe for UndoStack<T>where
T: UnwindSafe,
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