Skip to main content

Hook

Trait Hook 

Source
pub trait Hook<State: Clone + Serialize>: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn execute<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        ctx: &'life1 mut HookContext<State>,
        event: &'life2 LifecycleEvent,
    ) -> Pin<Box<dyn Future<Output = Result<HookAction, HookError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;

    // Provided method
    fn priority(&self) -> u8 { ... }
}

Required Methods§

Source

fn name(&self) -> &str

Source

fn execute<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 mut HookContext<State>, event: &'life2 LifecycleEvent, ) -> Pin<Box<dyn Future<Output = Result<HookAction, HookError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Provided Methods§

Source

fn priority(&self) -> u8

Execution priority (lower = earlier execution)

Implementors§