mod plugin_registry#

module plugin_registry#

Plugin registry for storing and retrieving provider plugins.

PluginRegistry is an instance-scoped (not global static) store for ProviderPlugin trait objects. Plugins are stored as Arc<dyn ProviderPlugin> keyed by plugin ID.

Instance-scoped design is more testable and can be promoted to a static later if needed.

Structs and Unions

struct PluginRegistry#

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

impl PluginRegistry#

Functions

fn deregister(&mut self, plugin_id: &str) -> bool#

Remove a plugin from the registry, returning true if it was present.

fn get(&self, plugin_id: &str) -> Option<Arc<dyn ProviderPlugin>>#

Retrieve a plugin by ID, returning an Arc clone.

fn is_empty(&self) -> bool#

Return true if the registry contains no plugins.

fn len(&self) -> usize#

Return the number of registered plugins.

fn list_plugin_ids(&self) -> Vec<String>#

Return a sorted list of all registered plugin IDs.

fn new() -> Self#

Create a new empty plugin registry.

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.

Traits implemented

impl Default for PluginRegistry#
impl std::fmt::Debug for PluginRegistry#