pub struct PluginRegistry { /* private fields */ }Expand description
Registry of loaded plugins.
Implementations§
Source§impl PluginRegistry
impl PluginRegistry
Sourcepub fn register(&mut self, plugin: Box<dyn Plugin>) -> Result<()>
pub fn register(&mut self, plugin: Box<dyn Plugin>) -> Result<()>
Register a plugin. Returns error if a plugin with the same ID already exists.
Sourcepub fn unregister(&mut self, id: &str) -> Result<()>
pub fn unregister(&mut self, id: &str) -> Result<()>
Unregister and shut down a plugin by ID.
Sourcepub fn get_mut(&mut self, id: &str) -> Option<&mut (dyn Plugin + 'static)>
pub fn get_mut(&mut self, id: &str) -> Option<&mut (dyn Plugin + 'static)>
Get a mutable reference to a registered plugin.
Sourcepub fn list(&self) -> Vec<&PluginManifest>
pub fn list(&self) -> Vec<&PluginManifest>
List all registered plugin manifests.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PluginRegistry
impl !RefUnwindSafe for PluginRegistry
impl Send for PluginRegistry
impl Sync for PluginRegistry
impl Unpin for PluginRegistry
impl UnsafeUnpin for PluginRegistry
impl !UnwindSafe for PluginRegistry
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