ExecutionHook

Trait ExecutionHook 

Source
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§

Source

fn execute( &mut self, context: &ExecutionContext, data: Option<&HookData>, ) -> SklResult<HookResult>

Execute the hook

Source

fn name(&self) -> &str

Get hook name

Source

fn should_execute(&self, phase: HookPhase) -> bool

Check if hook should execute for given phase

Provided Methods§

Source

fn priority(&self) -> i32

Get hook priority (higher values execute first)

Implementors§