pub struct HistoryManager { /* private fields */ }Expand description
Manages undo/redo stacks and change history
Implementations§
Source§impl HistoryManager
impl HistoryManager
Sourcepub fn record_change(&mut self, change: Change) -> Result<(), UndoRedoError>
pub fn record_change(&mut self, change: Change) -> Result<(), UndoRedoError>
Record a change in history
Sourcepub fn undo(&mut self) -> Result<Change, UndoRedoError>
pub fn undo(&mut self) -> Result<Change, UndoRedoError>
Perform an undo operation
Sourcepub fn redo(&mut self) -> Result<Change, UndoRedoError>
pub fn redo(&mut self) -> Result<Change, UndoRedoError>
Perform a redo operation
Sourcepub fn get_history(&self, limit: usize, offset: usize) -> Vec<HistoryEntry>
pub fn get_history(&self, limit: usize, offset: usize) -> Vec<HistoryEntry>
Get paginated history
Sourcepub fn get_change_details(
&self,
change_id: &str,
) -> Result<HistoryEntry, UndoRedoError>
pub fn get_change_details( &self, change_id: &str, ) -> Result<HistoryEntry, UndoRedoError>
Get details of a specific change
Sourcepub fn get_changes_by_file(&self, file_path: &str) -> Vec<HistoryEntry>
pub fn get_changes_by_file(&self, file_path: &str) -> Vec<HistoryEntry>
Get all changes for a specific file
Sourcepub fn total_changes(&self) -> usize
pub fn total_changes(&self) -> usize
Get the total number of changes in history
Sourcepub fn undoable_count(&self) -> usize
pub fn undoable_count(&self) -> usize
Get the number of undoable changes
Sourcepub fn redoable_count(&self) -> usize
pub fn redoable_count(&self) -> usize
Get the number of redoable changes
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HistoryManager
impl RefUnwindSafe for HistoryManager
impl Send for HistoryManager
impl Sync for HistoryManager
impl Unpin for HistoryManager
impl UnwindSafe for HistoryManager
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