pub struct HistoryStore { /* private fields */ }Expand description
Manages history persistence to disk
Implementations§
Source§impl HistoryStore
impl HistoryStore
Sourcepub fn new(storage_path: impl AsRef<Path>) -> Result<Self, UndoRedoError>
pub fn new(storage_path: impl AsRef<Path>) -> Result<Self, UndoRedoError>
Create a new history store with the given storage path
Sourcepub fn save_history(
&mut self,
snapshot: HistorySnapshot,
) -> Result<(), UndoRedoError>
pub fn save_history( &mut self, snapshot: HistorySnapshot, ) -> Result<(), UndoRedoError>
Save history to disk with retry logic
Sourcepub fn load_history(&mut self) -> Result<HistorySnapshot, UndoRedoError>
pub fn load_history(&mut self) -> Result<HistorySnapshot, UndoRedoError>
Load history from disk with fallback to empty history
Sourcepub fn cleanup_old_entries(
&mut self,
retention_days: i64,
) -> Result<(), UndoRedoError>
pub fn cleanup_old_entries( &mut self, retention_days: i64, ) -> Result<(), UndoRedoError>
Clean up entries older than the specified number of days
Sourcepub fn get_storage_stats(&self) -> Result<StorageStats, UndoRedoError>
pub fn get_storage_stats(&self) -> Result<StorageStats, UndoRedoError>
Get storage statistics
Sourcepub fn is_storage_full(&self) -> Result<bool, UndoRedoError>
pub fn is_storage_full(&self) -> Result<bool, UndoRedoError>
Check if storage is full (exceeds 1GB limit)
Sourcepub fn handle_storage_full(&self) -> Result<(), UndoRedoError>
pub fn handle_storage_full(&self) -> Result<(), UndoRedoError>
Handle storage full gracefully by logging warning
Sourcepub fn get_history_data(&self) -> Option<HistorySnapshot>
pub fn get_history_data(&self) -> Option<HistorySnapshot>
Get the current history data
Sourcepub fn set_history_data(&mut self, snapshot: HistorySnapshot)
pub fn set_history_data(&mut self, snapshot: HistorySnapshot)
Set the history data
Auto Trait Implementations§
impl Freeze for HistoryStore
impl RefUnwindSafe for HistoryStore
impl Send for HistoryStore
impl Sync for HistoryStore
impl Unpin for HistoryStore
impl UnwindSafe for HistoryStore
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