Skip to main content

ActionHandler

Trait ActionHandler 

Source
pub trait ActionHandler: Send + Sync {
    // Required methods
    fn execute(
        &self,
        action: &AutomatedAction,
    ) -> Result<ActionResult, ActionError>;
    fn can_execute(&self, action: &AutomatedAction) -> bool;
    fn estimated_time(&self, action: &AutomatedAction) -> Duration;
}
Expand description

Action handler trait for automated recovery

Required Methods§

Source

fn execute(&self, action: &AutomatedAction) -> Result<ActionResult, ActionError>

Execute the automated action

Source

fn can_execute(&self, action: &AutomatedAction) -> bool

Validate if action can be executed

Source

fn estimated_time(&self, action: &AutomatedAction) -> Duration

Get estimated execution time

Implementors§