pub struct PluginManager { /* private fields */ }Expand description
Main plugin manager
Implementations§
Source§impl PluginManager
impl PluginManager
pub fn new(config: PluginConfig) -> Self
Sourcepub async fn load_plugins_from_directory<P: AsRef<Path>>(
&mut self,
path: P,
) -> Result<()>
pub async fn load_plugins_from_directory<P: AsRef<Path>>( &mut self, path: P, ) -> Result<()>
Load plugins from a directory
Sourcepub async fn enable_plugin(&mut self, plugin_id: &str) -> Result<()>
pub async fn enable_plugin(&mut self, plugin_id: &str) -> Result<()>
Enable a plugin
Sourcepub async fn disable_plugin(&mut self, plugin_id: &str) -> Result<()>
pub async fn disable_plugin(&mut self, plugin_id: &str) -> Result<()>
Disable a plugin
Sourcepub async fn execute_hook(&self, hook: PluginHook) -> Result<HookResult>
pub async fn execute_hook(&self, hook: PluginHook) -> Result<HookResult>
Execute a hook across all registered plugins
Sourcepub fn list_plugins(&self) -> Vec<PluginInfo>
pub fn list_plugins(&self) -> Vec<PluginInfo>
Get a list of all plugins
Sourcepub async fn initialize(&self) -> Result<()>
pub async fn initialize(&self) -> Result<()>
Initialize all enabled plugins
Auto Trait Implementations§
impl Freeze for PluginManager
impl !RefUnwindSafe for PluginManager
impl Send for PluginManager
impl Sync for PluginManager
impl Unpin for PluginManager
impl !UnwindSafe for PluginManager
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