Struct Plugin Registry
Generated from cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-ffi.
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
impl PluginRegistry
new
pub fn new() -> Self
Create a new empty plugin registry.
register
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.
get
pub fn get(&self, plugin_id: &str) -> Option<Arc<dyn ProviderPlugin>>
Retrieve a plugin by ID, returning an Arc clone.
list_plugin_ids
pub fn list_plugin_ids(&self) -> Vec<String>
Return a sorted list of all registered plugin IDs.
deregister
pub fn deregister(&mut self, plugin_id: &str) -> bool
Remove a plugin from the registry, returning true if it was present.
len
pub fn len(&self) -> usize
Return the number of registered plugins.
is_empty
pub fn is_empty(&self) -> bool
Return true if the registry contains no plugins.
Trait Implementations
impl Debug for PluginRegistry
impl Debug for PluginRegistry
fmt
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Default for PluginRegistry
impl Default for PluginRegistry
default
fn default() -> Self