pub struct PluginRegistry { /* private fields */ }Expand description
Plugin registry
Maintains a catalog of available plugins, their metadata, and discovery information. The registry is separate from the manager - it tracks what plugins are available, while the manager tracks what plugins are actively loaded and running.
Implementations§
Source§impl PluginRegistry
impl PluginRegistry
Sourcepub fn add_search_path(&mut self, path: impl Into<PathBuf>)
pub fn add_search_path(&mut self, path: impl Into<PathBuf>)
Add a search path for plugin discovery
Sourcepub fn register(
&mut self,
metadata: PluginMetadata,
source: Option<PathBuf>,
) -> Result<(), PluginError>
pub fn register( &mut self, metadata: PluginMetadata, source: Option<PathBuf>, ) -> Result<(), PluginError>
Register a plugin
Adds a plugin to the registry with its metadata and optional source location.
Sourcepub fn register_plugin(
&mut self,
plugin: &Arc<dyn Plugin>,
) -> Result<(), PluginError>
pub fn register_plugin( &mut self, plugin: &Arc<dyn Plugin>, ) -> Result<(), PluginError>
Register a loaded plugin
Convenience method to register a plugin that’s already loaded.
Sourcepub fn mark_loaded(&mut self, name: &str) -> Result<(), PluginError>
pub fn mark_loaded(&mut self, name: &str) -> Result<(), PluginError>
Mark a plugin as loaded
Sourcepub fn mark_unloaded(&mut self, name: &str) -> Result<(), PluginError>
pub fn mark_unloaded(&mut self, name: &str) -> Result<(), PluginError>
Mark a plugin as unloaded
Sourcepub fn unregister(&mut self, name: &str) -> Result<(), PluginError>
pub fn unregister(&mut self, name: &str) -> Result<(), PluginError>
Unregister a plugin
Sourcepub fn get(&self, name: &str) -> Option<&PluginRegistryEntry>
pub fn get(&self, name: &str) -> Option<&PluginRegistryEntry>
Get a plugin entry
Sourcepub fn list_all(&self) -> Vec<&PluginRegistryEntry>
pub fn list_all(&self) -> Vec<&PluginRegistryEntry>
List all registered plugins
Sourcepub fn list_loaded(&self) -> Vec<&PluginRegistryEntry>
pub fn list_loaded(&self) -> Vec<&PluginRegistryEntry>
List loaded plugins
Sourcepub fn list_unloaded(&self) -> Vec<&PluginRegistryEntry>
pub fn list_unloaded(&self) -> Vec<&PluginRegistryEntry>
List unloaded plugins
Sourcepub fn find_by_capability(&self, capability: &str) -> Vec<&PluginRegistryEntry>
pub fn find_by_capability(&self, capability: &str) -> Vec<&PluginRegistryEntry>
Find plugins by capability
Sourcepub fn find_by_tag(&self, tag: &str) -> Vec<&PluginRegistryEntry>
pub fn find_by_tag(&self, tag: &str) -> Vec<&PluginRegistryEntry>
Find plugins by tag
Sourcepub fn add_tag(
&mut self,
name: &str,
tag: impl Into<String>,
) -> Result<(), PluginError>
pub fn add_tag( &mut self, name: &str, tag: impl Into<String>, ) -> Result<(), PluginError>
Add a tag to a plugin
Sourcepub fn remove_tag(&mut self, name: &str, tag: &str) -> Result<(), PluginError>
pub fn remove_tag(&mut self, name: &str, tag: &str) -> Result<(), PluginError>
Remove a tag from a plugin
Sourcepub fn stats(&self) -> PluginRegistryStats
pub fn stats(&self) -> PluginRegistryStats
Get registry statistics
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 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