pub struct PluginLoader { /* private fields */ }Expand description
A plugin loader that manages plugin discovery, loading, and lifecycle
Implementations§
Source§impl PluginLoader
impl PluginLoader
Sourcepub fn new(config: LoaderConfig) -> Self
pub fn new(config: LoaderConfig) -> Self
Create a new plugin loader with the given configuration
Sourcepub fn config(&self) -> &LoaderConfig
pub fn config(&self) -> &LoaderConfig
Get the current configuration
Sourcepub async fn load_plugin(
&self,
name: &str,
) -> Result<Arc<dyn VanguardPlugin>, LoaderError>
pub async fn load_plugin( &self, name: &str, ) -> Result<Arc<dyn VanguardPlugin>, LoaderError>
Load a plugin by name
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 a loaded plugin by name
Sourcepub async fn list_plugins(&self) -> Vec<PluginMetadata>
pub async fn list_plugins(&self) -> Vec<PluginMetadata>
List all loaded plugins
Sourcepub async fn unload_plugin(&self, name: &str) -> Result<(), LoaderError>
pub async fn unload_plugin(&self, name: &str) -> Result<(), LoaderError>
Unload a plugin by name
Sourcepub async fn discover_plugins(&self) -> Result<Vec<PluginMetadata>, LoaderError>
pub async fn discover_plugins(&self) -> Result<Vec<PluginMetadata>, LoaderError>
Discover available plugins in the plugin directory
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for PluginLoader
impl !RefUnwindSafe for PluginLoader
impl Send for PluginLoader
impl Sync for PluginLoader
impl Unpin for PluginLoader
impl !UnwindSafe for PluginLoader
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