pub struct HookRegistry { /* private fields */ }Expand description
Hook registry
Maintains mappings between hook points and the plugins that should be invoked at those points. This allows for efficient hook execution.
Implementations§
Source§impl HookRegistry
impl HookRegistry
Sourcepub fn register_hook(&mut self, hook: HookPoint, plugin: Arc<dyn Plugin>)
pub fn register_hook(&mut self, hook: HookPoint, plugin: Arc<dyn Plugin>)
Register a plugin for a specific hook point
Sourcepub fn unregister_hook(&mut self, hook: HookPoint, plugin_name: &str)
pub fn unregister_hook(&mut self, hook: HookPoint, plugin_name: &str)
Unregister a plugin from a specific hook point
Sourcepub fn unregister_plugin(&mut self, plugin_name: &str)
pub fn unregister_plugin(&mut self, plugin_name: &str)
Unregister a plugin from all hook points
Sourcepub fn get_plugins(&self, hook: HookPoint) -> Vec<Arc<dyn Plugin>>
pub fn get_plugins(&self, hook: HookPoint) -> Vec<Arc<dyn Plugin>>
Get all plugins registered for a hook point
Sourcepub fn count_plugins(&self, hook: HookPoint) -> usize
pub fn count_plugins(&self, hook: HookPoint) -> usize
Get the number of plugins registered for a hook point
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 !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