pub struct RollbackHandler { /* private fields */ }Expand description
Handles rollback of executed steps
Tracks rollback actions for each step and executes them in reverse order to restore the system to its pre-execution state.
Implementations§
Source§impl RollbackHandler
impl RollbackHandler
Sourcepub fn track_action(&mut self, step_id: String, action: RollbackAction)
pub fn track_action(&mut self, step_id: String, action: RollbackAction)
Track a rollback action for a step
§Arguments
step_id- ID of the step being trackedaction- Rollback action to execute if needed
Sourcepub fn track_step(&mut self, step: &ExecutionStep)
pub fn track_step(&mut self, step: &ExecutionStep)
Track rollback action from a step
Extracts the rollback action from a step and tracks it.
Sourcepub fn execute_rollback(&mut self) -> ExecutionResult<Vec<RollbackResult>>
pub fn execute_rollback(&mut self) -> ExecutionResult<Vec<RollbackResult>>
Execute rollback for all tracked actions
Executes rollback actions in reverse order (LIFO) to undo changes. Stops on first error unless partial rollback is enabled.
§Returns
A vector of rollback results for each action executed
Sourcepub fn execute_partial_rollback(
&mut self,
step_ids: &[String],
) -> ExecutionResult<Vec<RollbackResult>>
pub fn execute_partial_rollback( &mut self, step_ids: &[String], ) -> ExecutionResult<Vec<RollbackResult>>
Sourcepub fn verify_completeness(&self) -> bool
pub fn verify_completeness(&self) -> bool
Verify rollback completeness
Checks that all rollback actions have been executed and the system is in a consistent state.
§Returns
true if rollback is complete and consistent, false otherwise
Sourcepub fn action_count(&self) -> usize
pub fn action_count(&self) -> usize
Get the number of tracked rollback actions
Sourcepub fn is_in_progress(&self) -> bool
pub fn is_in_progress(&self) -> bool
Check if rollback is currently in progress