pub struct PluginManager { /* private fields */ }Expand description
Registry and manager for package lifecycle plugins.
Tracks registered plugins and dispatches lifecycle hooks to all plugins that declare support for a given hook point.
Implementations§
Source§impl PluginManager
impl PluginManager
Sourcepub fn register(&mut self, metadata: PluginMetadata) -> KernelResult<()>
pub fn register(&mut self, metadata: PluginMetadata) -> KernelResult<()>
Register a new plugin. Returns an error if a plugin with the same name is already registered.
Sourcepub fn unregister(&mut self, name: &str) -> KernelResult<()>
pub fn unregister(&mut self, name: &str) -> KernelResult<()>
Unregister a plugin by name. Returns an error if the plugin is not found.
Sourcepub fn get(&self, name: &str) -> Option<&PluginInstance>
pub fn get(&self, name: &str) -> Option<&PluginInstance>
Look up a plugin instance by name.
Sourcepub fn invoke_hook(
&self,
hook: PluginHook,
package_name: &str,
) -> KernelResult<()>
pub fn invoke_hook( &self, hook: PluginHook, package_name: &str, ) -> KernelResult<()>
Invoke a lifecycle hook on all plugins that support it.
Iterates through every registered plugin and, for those that declare
support for hook, logs the invocation.
TODO(user-space): Actual plugin execution requires ELF dynamic loading and user-space process spawning. Currently this validates and logs which plugins would be invoked.
Trait Implementations§
Source§impl Clone for PluginManager
impl Clone for PluginManager
Source§fn clone(&self) -> PluginManager
fn clone(&self) -> PluginManager
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PluginManager
impl Debug for PluginManager
Auto Trait Implementations§
impl Freeze for PluginManager
impl RefUnwindSafe for PluginManager
impl Send for PluginManager
impl Sync for PluginManager
impl Unpin for PluginManager
impl UnwindSafe for PluginManager
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)