pub struct HookRegistry { /* private fields */ }Expand description
Registry for managing hooks
Implementations§
Source§impl HookRegistry
impl HookRegistry
Sourcepub fn add_hook(&mut self, name: &str, callback: HookCallback)
pub fn add_hook(&mut self, name: &str, callback: HookCallback)
Add a hook callback for a specific hook name
Sourcepub fn remove_hooks(&mut self, name: &str)
pub fn remove_hooks(&mut self, name: &str)
Remove all hooks for a specific name
Sourcepub fn hook_count(&self, name: &str) -> usize
pub fn hook_count(&self, name: &str) -> usize
Get count of registered callbacks for a hook
Sourcepub fn hook_names(&self) -> Vec<String>
pub fn hook_names(&self) -> Vec<String>
Get all registered hook names
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HookRegistry
impl !RefUnwindSafe for HookRegistry
impl Send for HookRegistry
impl Sync for HookRegistry
impl Unpin for HookRegistry
impl UnsafeUnpin for HookRegistry
impl !UnwindSafe for HookRegistry
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