Skip to main content

PluginManager

Trait PluginManager 

Source
pub trait PluginManager {
    // Required methods
    fn discover_plugins(&self) -> Result<HashMap<String, PluginInfo>>;
    fn is_compatible(&self, name: &str, version: &str) -> Result<bool>;
    fn load_plugin(&self, name: &str) -> Result<Box<dyn Plugin>>;
    fn list_plugins(&self) -> Vec<String>;
}
Expand description

Plugin discovery and management interface.

This trait provides methods for discovering available plugins, checking compatibility, and loading plugin instances.

Required Methods§

Source

fn discover_plugins(&self) -> Result<HashMap<String, PluginInfo>>

Discovers all available plugins in the system.

§Returns

A map of plugin names to their information metadata.

Source

fn is_compatible(&self, name: &str, version: &str) -> Result<bool>

Checks if a plugin is compatible with the current system.

§Arguments
  • name - The name of the plugin to check
  • version - The required version specification
§Returns

Returns true if the plugin is compatible, false otherwise.

Source

fn load_plugin(&self, name: &str) -> Result<Box<dyn Plugin>>

Loads a plugin by name.

§Arguments
  • name - The name of the plugin to load
§Returns

Returns a boxed plugin instance ready for use.

Source

fn list_plugins(&self) -> Vec<String>

Lists all available plugin names.

§Returns

A vector of plugin names that can be loaded.

Implementors§