pub struct RollbackManager;Expand description
Manages rollback steps and recovery for failed workflows
Responsible for:
- Tracking rollback steps for each executed step
- Executing rollback steps in reverse order on failure
- Restoring workflow state after rollback
Implementations§
Source§impl RollbackManager
impl RollbackManager
Sourcepub fn create_rollback_plan(workflow: &Workflow) -> RollbackPlan
pub fn create_rollback_plan(workflow: &Workflow) -> RollbackPlan
Create a rollback plan for a workflow
Sourcepub fn execute_rollback(
workflow: &Workflow,
state: &mut WorkflowState,
rollback_plan: &RollbackPlan,
) -> WorkflowResult<()>
pub fn execute_rollback( workflow: &Workflow, state: &mut WorkflowState, rollback_plan: &RollbackPlan, ) -> WorkflowResult<()>
Execute rollback steps in reverse order
Executes all rollback steps that were defined for the failed step, in reverse order of execution.
Sourcepub fn restore_state(state: &mut WorkflowState) -> WorkflowResult<()>
pub fn restore_state(state: &mut WorkflowState) -> WorkflowResult<()>
Restore workflow state after rollback
Clears the completed steps and step results to restore the workflow to a state where it can be resumed or restarted.
Sourcepub fn has_rollback_steps(rollback_plan: &RollbackPlan, step_id: &str) -> bool
pub fn has_rollback_steps(rollback_plan: &RollbackPlan, step_id: &str) -> bool
Check if a step has rollback steps defined
Sourcepub fn get_rollback_steps(
rollback_plan: &RollbackPlan,
step_id: &str,
) -> Vec<String>
pub fn get_rollback_steps( rollback_plan: &RollbackPlan, step_id: &str, ) -> Vec<String>
Get rollback steps for a specific step
Sourcepub fn add_rollback_step(
rollback_plan: &mut RollbackPlan,
step_id: String,
rollback_step: String,
)
pub fn add_rollback_step( rollback_plan: &mut RollbackPlan, step_id: String, rollback_step: String, )
Add a rollback step to the plan
Sourcepub fn record_step_execution(rollback_plan: &mut RollbackPlan, step_id: String)
pub fn record_step_execution(rollback_plan: &mut RollbackPlan, step_id: String)
Record step execution in the rollback plan
Auto Trait Implementations§
impl Freeze for RollbackManager
impl RefUnwindSafe for RollbackManager
impl Send for RollbackManager
impl Sync for RollbackManager
impl Unpin for RollbackManager
impl UnwindSafe for RollbackManager
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