pub struct DocumentHistory { /* private fields */ }Expand description
Implementations§
Source§impl DocumentHistory
impl DocumentHistory
Sourcepub fn push(&mut self, change: DocumentChange)
pub fn push(&mut self, change: DocumentChange)
Records a new change. Any future (redo) stack is cleared.
Sourcepub fn undo(&mut self) -> Option<&DocumentChange>
pub fn undo(&mut self) -> Option<&DocumentChange>
Removes the most-recent change from the undo stack and returns a
reference to it, or None if the stack is empty.
The inverse of the returned change is placed on the redo stack.
Sourcepub fn redo(&mut self) -> Option<&DocumentChange>
pub fn redo(&mut self) -> Option<&DocumentChange>
Re-applies the most-recently-undone change and returns a reference
to it, or None if the redo stack is empty.
Trait Implementations§
Source§impl Debug for DocumentHistory
impl Debug for DocumentHistory
Source§impl Default for DocumentHistory
impl Default for DocumentHistory
Source§fn default() -> DocumentHistory
fn default() -> DocumentHistory
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DocumentHistory
impl RefUnwindSafe for DocumentHistory
impl Send for DocumentHistory
impl Sync for DocumentHistory
impl Unpin for DocumentHistory
impl UnsafeUnpin for DocumentHistory
impl UnwindSafe for DocumentHistory
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