pub struct HistoryManager { /* private fields */ }Expand description
Main API for history management
Implementations§
Source§impl HistoryManager
impl HistoryManager
Sourcepub fn graph(&self) -> &OperationGraph
pub fn graph(&self) -> &OperationGraph
Get the operation graph
Sourcepub fn record_operation(
&mut self,
operation_type: OperationType,
target_dir: &Path,
) -> Result<Operation>
pub fn record_operation( &mut self, operation_type: OperationType, target_dir: &Path, ) -> Result<Operation>
Record an operation and create a checkpoint
Sourcepub fn rollback(
&mut self,
operation_id: &str,
target_dir: &Path,
) -> Result<RollbackResult>
pub fn rollback( &mut self, operation_id: &str, target_dir: &Path, ) -> Result<RollbackResult>
Rollback to a specific operation (undo operations after it)
Sourcepub fn restore(&self, checkpoint_id: &str, target_dir: &Path) -> Result<()>
pub fn restore(&self, checkpoint_id: &str, target_dir: &Path) -> Result<()>
Restore to a specific checkpoint (without modifying graph)
Sourcepub fn detect_changes(&self, target_dir: &Path) -> Result<ChangeDetectionResult>
pub fn detect_changes(&self, target_dir: &Path) -> Result<ChangeDetectionResult>
Detect user edits since last recorded operation
Sourcepub fn sync(&mut self, target_dir: &Path) -> Result<Option<Operation>>
pub fn sync(&mut self, target_dir: &Path) -> Result<Option<Operation>>
Sync: detect and record user edits as an operation
Sourcepub fn list_history(&self, limit: Option<usize>) -> Vec<HistoryEntry>
pub fn list_history(&self, limit: Option<usize>) -> Vec<HistoryEntry>
List recent operations
Sourcepub fn get_operation(&self, operation_id: &str) -> Option<&Operation>
pub fn get_operation(&self, operation_id: &str) -> Option<&Operation>
Get operation details
Sourcepub fn get_checkpoint(&self, operation_id: &str) -> Result<Option<Checkpoint>>
pub fn get_checkpoint(&self, operation_id: &str) -> Result<Option<Checkpoint>>
Get checkpoint for an operation
Sourcepub fn prune_checkpoints(&mut self, keep_count: usize) -> Result<usize>
pub fn prune_checkpoints(&mut self, keep_count: usize) -> Result<usize>
Prune old checkpoints
Sourcepub fn get_ancestry(&self, operation_id: &str) -> Vec<&Operation>
pub fn get_ancestry(&self, operation_id: &str) -> Vec<&Operation>
Get ancestry of an operation
Sourcepub fn init_cache(&mut self, target_dir: &Path) -> Result<()>
pub fn init_cache(&mut self, target_dir: &Path) -> Result<()>
Initialize cache for a target directory
Auto Trait Implementations§
impl Freeze for HistoryManager
impl RefUnwindSafe for HistoryManager
impl Send for HistoryManager
impl Sync for HistoryManager
impl Unpin for HistoryManager
impl UnsafeUnpin 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