Expand description
Undo/restore mechanism for file mutations.
Provides an UndoStack that captures file snapshots before modifications
and can restore them on demand. Callers use it explicitly around mutating
operations:
use toride_ssh_core::undo::{UndoStack, UndoResult};
use std::path::Path;
let mut undo = UndoStack::new(20);
undo.snapshot(config_path).await?;
// ... perform mutation ...
// If something goes wrong, roll back:
undo.restore_last().await?;Structs§
- File
Snapshot - Captured state of a single file at a point in time.
- Undo
Stack - A stack of
FileSnapshots that supports restoring files to earlier states.
Enums§
- Undo
Error - Errors specific to undo operations.
Constants§
- DEFAULT_
MAX_ DEPTH - Default maximum depth for the undo stack.
Type Aliases§
- Undo
Result - Result type for undo operations.