pub struct NodeUndoRedoStack {
pub node_id: NodeId,
pub undo_stack: VecDeque<UndoableOperation>,
pub redo_stack: VecDeque<UndoableOperation>,
}Expand description
Per-node undo/redo stack
Fields§
§node_id: NodeIdNode ID this stack belongs to
undo_stack: VecDeque<UndoableOperation>Undo stack (most recent at back)
redo_stack: VecDeque<UndoableOperation>Redo stack (most recent at back)
Implementations§
Source§impl NodeUndoRedoStack
impl NodeUndoRedoStack
pub fn new(node_id: NodeId) -> Self
Sourcepub fn push_undo(&mut self, operation: UndoableOperation)
pub fn push_undo(&mut self, operation: UndoableOperation)
Push a new operation to the undo stack
Sourcepub fn pop_undo(&mut self) -> Option<UndoableOperation>
pub fn pop_undo(&mut self) -> Option<UndoableOperation>
Pop the most recent operation from undo stack
Sourcepub fn push_redo(&mut self, operation: UndoableOperation)
pub fn push_redo(&mut self, operation: UndoableOperation)
Push an operation to the redo stack (after undo)
Sourcepub fn pop_redo(&mut self) -> Option<UndoableOperation>
pub fn pop_redo(&mut self) -> Option<UndoableOperation>
Pop the most recent operation from redo stack
Sourcepub fn peek_undo(&self) -> Option<&UndoableOperation>
pub fn peek_undo(&self) -> Option<&UndoableOperation>
Peek at the most recent undo operation without removing it
Sourcepub fn peek_redo(&self) -> Option<&UndoableOperation>
pub fn peek_redo(&self) -> Option<&UndoableOperation>
Peek at the most recent redo operation without removing it
Trait Implementations§
Source§impl Clone for NodeUndoRedoStack
impl Clone for NodeUndoRedoStack
Source§fn clone(&self) -> NodeUndoRedoStack
fn clone(&self) -> NodeUndoRedoStack
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for NodeUndoRedoStack
impl RefUnwindSafe for NodeUndoRedoStack
impl Send for NodeUndoRedoStack
impl Sync for NodeUndoRedoStack
impl Unpin for NodeUndoRedoStack
impl UnwindSafe for NodeUndoRedoStack
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more