RollbackManager

Struct RollbackManager 

Source
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

Source

pub fn create_rollback_plan(workflow: &Workflow) -> RollbackPlan

Create a rollback plan for a workflow

Source

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.

Source

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.

Source

pub fn has_rollback_steps(rollback_plan: &RollbackPlan, step_id: &str) -> bool

Check if a step has rollback steps defined

Source

pub fn get_rollback_steps( rollback_plan: &RollbackPlan, step_id: &str, ) -> Vec<String>

Get rollback steps for a specific step

Source

pub fn add_rollback_step( rollback_plan: &mut RollbackPlan, step_id: String, rollback_step: String, )

Add a rollback step to the plan

Source

pub fn record_step_execution(rollback_plan: &mut RollbackPlan, step_id: String)

Record step execution in the rollback plan

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.