pub struct UndoStack { /* private fields */ }Expand description
Undo/redo stack with efficient memory management
Uses a circular buffer design with arena allocation for optimal performance. Supports configurable limits and automatic cleanup.
Implementations§
Source§impl UndoStack
impl UndoStack
Sourcepub fn with_config(config: UndoStackConfig) -> Self
pub fn with_config(config: UndoStackConfig) -> Self
Create a new undo stack with custom configuration
Sourcepub fn push(&mut self, entry: HistoryEntry)
pub fn push(&mut self, entry: HistoryEntry)
Push a new entry onto the undo stack
This clears the redo stack as new operations invalidate previously undone operations.
Sourcepub fn pop_undo(&mut self) -> Option<HistoryEntry>
pub fn pop_undo(&mut self) -> Option<HistoryEntry>
Pop the most recent entry from the undo stack
Sourcepub fn push_redo(&mut self, entry: HistoryEntry)
pub fn push_redo(&mut self, entry: HistoryEntry)
Push an entry onto the redo stack
Sourcepub fn pop_redo(&mut self) -> Option<HistoryEntry>
pub fn pop_redo(&mut self) -> Option<HistoryEntry>
Pop an entry from the redo stack
Sourcepub fn undo_count(&self) -> usize
pub fn undo_count(&self) -> usize
Get the number of undo entries available
Sourcepub fn redo_count(&self) -> usize
pub fn redo_count(&self) -> usize
Get the number of redo entries available
Sourcepub fn memory_usage(&self) -> usize
pub fn memory_usage(&self) -> usize
Get current memory usage in bytes
Sourcepub fn next_undo_description(&self) -> Option<&str>
pub fn next_undo_description(&self) -> Option<&str>
Get description of the next undo operation
Sourcepub fn next_redo_description(&self) -> Option<&str>
pub fn next_redo_description(&self) -> Option<&str>
Get description of the next redo operation
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for UndoStack
impl !RefUnwindSafe for UndoStack
impl Send for UndoStack
impl !Sync for UndoStack
impl Unpin for UndoStack
impl !UnwindSafe 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