pub struct PluginRegistry { /* private fields */ }Expand description
Registry for managing multiple versions of plugins
The registry keeps track of all installed plugin versions and their states, as well as which version is currently active for each plugin.
Implementations§
Source§impl PluginRegistry
impl PluginRegistry
Sourcepub async fn register_plugin(
&self,
plugin: Arc<dyn VanguardPlugin>,
) -> Result<(), RegistryError>
pub async fn register_plugin( &self, plugin: Arc<dyn VanguardPlugin>, ) -> Result<(), RegistryError>
Register a new plugin version
Sourcepub async fn get_active_version(
&self,
name: &str,
) -> Result<Arc<dyn VanguardPlugin>, RegistryError>
pub async fn get_active_version( &self, name: &str, ) -> Result<Arc<dyn VanguardPlugin>, RegistryError>
Get the currently active version of a plugin
Sourcepub async fn get_plugin(&self, name: &str) -> Option<Arc<dyn VanguardPlugin>>
pub async fn get_plugin(&self, name: &str) -> Option<Arc<dyn VanguardPlugin>>
Get any version of a plugin (usually the latest)
Sourcepub async fn activate_version(
&self,
name: &str,
version_str: &str,
) -> Result<(), RegistryError>
pub async fn activate_version( &self, name: &str, version_str: &str, ) -> Result<(), RegistryError>
Activate a specific version of a plugin
Sourcepub async fn get_plugin_state(
&self,
name: &str,
version_str: &str,
) -> Result<PluginState, RegistryError>
pub async fn get_plugin_state( &self, name: &str, version_str: &str, ) -> Result<PluginState, RegistryError>
Get the state of a specific plugin version
Sourcepub async fn set_plugin_state(
&self,
name: &str,
version_str: &str,
state: PluginState,
) -> Result<(), RegistryError>
pub async fn set_plugin_state( &self, name: &str, version_str: &str, state: PluginState, ) -> Result<(), RegistryError>
Set the state of a specific plugin version
Sourcepub async fn remove_plugin(
&self,
name: &str,
version_str: &str,
) -> Result<(), RegistryError>
pub async fn remove_plugin( &self, name: &str, version_str: &str, ) -> Result<(), RegistryError>
Remove a specific version of a plugin
Sourcepub async fn save_plugin_info(
&self,
plugin_info: &PluginInfo,
) -> Result<(), RegistryError>
pub async fn save_plugin_info( &self, plugin_info: &PluginInfo, ) -> Result<(), RegistryError>
Save plugin information to the registry directory
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 !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