pub struct HookManager { /* private fields */ }Expand description
Manages hook registration and firing.
Implementations§
Source§impl HookManager
impl HookManager
Sourcepub fn register(&mut self, point: HookPoint, hook: Box<dyn Hook>)
pub fn register(&mut self, point: HookPoint, hook: Box<dyn Hook>)
Register a hook at a specific point.
Sourcepub fn fire(&self, context: &HookContext) -> HookResult
pub fn fire(&self, context: &HookContext) -> HookResult
Fire all hooks at a given point.
Returns HookResult::Continue if all hooks allow, or the first Block result.
Sourcepub fn count_at(&self, point: HookPoint) -> usize
pub fn count_at(&self, point: HookPoint) -> usize
Number of hooks registered at a specific point.
Sourcepub fn total_hooks(&self) -> usize
pub fn total_hooks(&self) -> usize
Total number of registered hooks.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HookManager
impl !RefUnwindSafe for HookManager
impl Send for HookManager
impl Sync for HookManager
impl Unpin for HookManager
impl UnsafeUnpin for HookManager
impl !UnwindSafe for HookManager
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