pub trait ExecutionStrategy: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn execute(
&self,
task: &dyn ExecutableTask,
context: &ExecutionContext,
) -> SklResult<ExecutionResult>;
fn can_handle(&self, task: &dyn ExecutableTask) -> bool;
fn config(&self) -> &StrategyConfig;
fn clone_strategy(&self) -> Box<dyn ExecutionStrategy>;
}Expand description
Execution strategy trait for pluggable execution behaviors
Required Methods§
Sourcefn execute(
&self,
task: &dyn ExecutableTask,
context: &ExecutionContext,
) -> SklResult<ExecutionResult>
fn execute( &self, task: &dyn ExecutableTask, context: &ExecutionContext, ) -> SklResult<ExecutionResult>
Execute a task with this strategy
Sourcefn can_handle(&self, task: &dyn ExecutableTask) -> bool
fn can_handle(&self, task: &dyn ExecutableTask) -> bool
Check if strategy can handle the given task
Sourcefn config(&self) -> &StrategyConfig
fn config(&self) -> &StrategyConfig
Get strategy configuration
Sourcefn clone_strategy(&self) -> Box<dyn ExecutionStrategy>
fn clone_strategy(&self) -> Box<dyn ExecutionStrategy>
Clone the strategy