pub struct PluginRegistry { /* private fields */ }Expand description
Registry for storing and retrieving provider plugins.
Instance-scoped (not a global static) for testability. Stores plugins
as Arc<dyn ProviderPlugin> keyed by plugin ID.
Implementations§
Source§impl PluginRegistry
impl PluginRegistry
Sourcepub fn register(&mut self, plugin: Arc<dyn ProviderPlugin>) -> Result<()>
pub fn register(&mut self, plugin: Arc<dyn ProviderPlugin>) -> Result<()>
Register a plugin in the registry.
Returns Err(AcgError::PluginAlreadyRegistered) if a plugin with
the same ID is already registered.
Sourcepub fn get(&self, plugin_id: &str) -> Option<Arc<dyn ProviderPlugin>>
pub fn get(&self, plugin_id: &str) -> Option<Arc<dyn ProviderPlugin>>
Retrieve a plugin by ID, returning an Arc clone.
Sourcepub fn list_plugin_ids(&self) -> Vec<String>
pub fn list_plugin_ids(&self) -> Vec<String>
Return a sorted list of all registered plugin IDs.
Sourcepub fn deregister(&mut self, plugin_id: &str) -> bool
pub fn deregister(&mut self, plugin_id: &str) -> bool
Remove a plugin from the registry, returning true if it was present.
Trait Implementations§
Source§impl Debug for PluginRegistry
impl Debug for PluginRegistry
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