pub trait ExecutionHook:
Send
+ Sync
+ Debug {
// Required methods
fn execute(
&mut self,
context: &ExecutionContext,
data: Option<&HookData>,
) -> SklResult<HookResult>;
fn name(&self) -> &str;
fn should_execute(&self, phase: HookPhase) -> bool;
// Provided method
fn priority(&self) -> i32 { ... }
}Expand description
Trait for implementing execution hooks
Required Methods§
Sourcefn execute(
&mut self,
context: &ExecutionContext,
data: Option<&HookData>,
) -> SklResult<HookResult>
fn execute( &mut self, context: &ExecutionContext, data: Option<&HookData>, ) -> SklResult<HookResult>
Execute the hook
Sourcefn should_execute(&self, phase: HookPhase) -> bool
fn should_execute(&self, phase: HookPhase) -> bool
Check if hook should execute for given phase