pub struct HookSystem { /* private fields */ }Expand description
Hook 系统实现
Implementations§
Source§impl HookSystem
impl HookSystem
Trait Implementations§
Source§impl Default for HookSystem
impl Default for HookSystem
Source§impl HookSystemTrait for HookSystem
impl HookSystemTrait for HookSystem
Source§fn on_before(&self, event: HookEvent, callback: HookCallback)
fn on_before(&self, event: HookEvent, callback: HookCallback)
注册前置钩子
Source§fn on_after(&self, event: HookEvent, callback: HookCallback)
fn on_after(&self, event: HookEvent, callback: HookCallback)
注册后置钩子
Source§fn trigger<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 HookContext,
) -> Pin<Box<dyn Future<Output = Layer2Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn trigger<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 HookContext,
) -> Pin<Box<dyn Future<Output = Layer2Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
触发钩子
Auto Trait Implementations§
impl !Freeze for HookSystem
impl !RefUnwindSafe for HookSystem
impl !UnwindSafe for HookSystem
impl Send for HookSystem
impl Sync for HookSystem
impl Unpin for HookSystem
impl UnsafeUnpin for HookSystem
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more