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§
Sourcefn 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 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,
处理钩子
Sourcefn supports_hook(&self, hook: &PluginHook) -> bool
fn supports_hook(&self, hook: &PluginHook) -> bool
钩子是否支持特定类型
Sourcefn get_priority(&self, hook: &PluginHook) -> HookPriority
fn get_priority(&self, hook: &PluginHook) -> HookPriority
获取钩子优先级