pub struct PluginManager { /* private fields */ }Expand description
Plugin manager handles plugin lifecycle
Implementations§
Source§impl PluginManager
impl PluginManager
Sourcepub async fn discover_plugins(&self) -> Result<Vec<String>>
pub async fn discover_plugins(&self) -> Result<Vec<String>>
Discover and load plugins
Sourcepub async fn load_plugin(&self, plugin_path: &PathBuf) -> Result<String>
pub async fn load_plugin(&self, plugin_path: &PathBuf) -> Result<String>
Load a plugin from a directory
Sourcepub async fn deactivate(&self, plugin_id: &str) -> Result<()>
pub async fn deactivate(&self, plugin_id: &str) -> Result<()>
Deactivate a plugin
Sourcepub async fn emit(&self, event: PluginEvent) -> Vec<HookResult>
pub async fn emit(&self, event: PluginEvent) -> Vec<HookResult>
Emit an event to all registered hooks
Sourcepub async fn get_plugin(&self, plugin_id: &str) -> Option<PluginInstance>
pub async fn get_plugin(&self, plugin_id: &str) -> Option<PluginInstance>
Get plugin instance
Sourcepub async fn list_plugins(&self) -> Vec<PluginInstance>
pub async fn list_plugins(&self) -> Vec<PluginInstance>
List all plugins
Sourcepub async fn get_config(&self, plugin_id: &str) -> Option<Value>
pub async fn get_config(&self, plugin_id: &str) -> Option<Value>
Get plugin configuration
Sourcepub async fn set_config(&self, plugin_id: &str, config: Value) -> Result<()>
pub async fn set_config(&self, plugin_id: &str, config: Value) -> Result<()>
Set plugin configuration
Sourcepub async fn create_context(&self, plugin_id: &str) -> Result<PluginContext>
pub async fn create_context(&self, plugin_id: &str) -> Result<PluginContext>
Create plugin context
Auto Trait Implementations§
impl Freeze for PluginManager
impl !RefUnwindSafe for PluginManager
impl Send for PluginManager
impl Sync for PluginManager
impl Unpin for PluginManager
impl UnsafeUnpin 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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more