Skip to main content

Module undo

Module undo 

Source
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§

FileSnapshot
Captured state of a single file at a point in time.
UndoStack
A stack of FileSnapshots that supports restoring files to earlier states.

Enums§

UndoError
Errors specific to undo operations.

Constants§

DEFAULT_MAX_DEPTH
Default maximum depth for the undo stack.

Type Aliases§

UndoResult
Result type for undo operations.