PluginRegistry

Struct PluginRegistry 

Source
pub struct PluginRegistry { /* private fields */ }
Expand description

Plugin registry that manages all loaded plugins

The registry is responsible for:

  • Loading and registering plugins
  • Discovering tools and package managers
  • Managing plugin lifecycle
  • Resolving plugin dependencies

Implementations§

Source§

impl PluginRegistry

Source

pub fn new() -> Self

Create a new empty plugin registry

Source

pub async fn register_plugin(&self, plugin: Box<dyn VxPlugin>) -> Result<()>

Register a plugin with the registry

This method adds a plugin to the registry and updates the internal indexes for quick tool and package manager lookup.

Source

pub async fn unregister_plugin(&self, plugin_name: &str) -> Result<()>

Unregister a plugin from the registry

This method removes a plugin and cleans up all associated indexes.

Source

pub fn get_tool(&self, tool_name: &str) -> Option<Box<dyn VxTool>>

Get a tool by name

Returns the tool implementation if found in any registered plugin.

Source

pub fn get_package_manager( &self, pm_name: &str, ) -> Option<Box<dyn VxPackageManager>>

Get a package manager by name

Returns the package manager implementation if found in any registered plugin.

Source

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

List all registered plugins

Returns a vector of plugin names currently registered.

Source

pub fn list_tools(&self) -> Vec<String>

List all available tools

Returns a vector of tool names from all registered plugins.

Source

pub fn list_package_managers(&self) -> Vec<String>

List all available package managers

Returns a vector of package manager names from all registered plugins.

Source

pub fn has_tool(&self, tool_name: &str) -> bool

Check if a tool is available

Returns true if any registered plugin provides the specified tool.

Source

pub fn has_package_manager(&self, pm_name: &str) -> bool

Check if a package manager is available

Returns true if any registered plugin provides the specified package manager.

Source

pub fn get_plugin_info( &self, plugin_name: &str, ) -> Option<HashMap<String, String>>

Get plugin information

Returns metadata about a specific plugin if it’s registered.

Source

pub fn get_all_plugin_info(&self) -> HashMap<String, HashMap<String, String>>

Get all plugin information

Returns metadata for all registered plugins.

Source

pub async fn shutdown_all(&self) -> Result<()>

Shutdown all plugins

This method shuts down all registered plugins and clears the registry. It should be called when the application is shutting down.

Trait Implementations§

Source§

impl Default for PluginRegistry

Source§

fn default() -> PluginRegistry

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.