HookHandler

Trait HookHandler 

Source
pub trait HookHandler: Send + Sync {
    // Required methods
    fn handle_hook<'life0, 'life1, 'async_trait>(
        &'life0 self,
        hook: PluginHook,
        context: &'life1 mut HookContext,
    ) -> Pin<Box<dyn Future<Output = Result<(), SyncError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn supports_hook(&self, hook: &PluginHook) -> bool;
    fn get_priority(&self, hook: &PluginHook) -> HookPriority;
}

Required Methods§

Source

fn handle_hook<'life0, 'life1, 'async_trait>( &'life0 self, hook: PluginHook, context: &'life1 mut HookContext, ) -> Pin<Box<dyn Future<Output = Result<(), SyncError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

处理钩子

Source

fn supports_hook(&self, hook: &PluginHook) -> bool

钩子是否支持特定类型

Source

fn get_priority(&self, hook: &PluginHook) -> HookPriority

获取钩子优先级

Implementors§