pub struct PluginManager { /* private fields */ }Expand description
Main plugin manager that handles all plugin operations.
Implementations§
Source§impl PluginManager
impl PluginManager
Sourcepub fn new(config: PluginConfig) -> Result<Self>
pub fn new(config: PluginConfig) -> Result<Self>
Create a new plugin manager with the given configuration.
Sourcepub fn with_defaults() -> Result<Self>
pub fn with_defaults() -> Result<Self>
Create a new plugin manager with default configuration.
Sourcepub fn initialize(&mut self) -> Result<()>
pub fn initialize(&mut self) -> Result<()>
Initialize the plugin system.
This registers all API functions and loads the prelude.
Sourcepub fn load_all(&mut self, project_root: &Path) -> Result<()>
pub fn load_all(&mut self, project_root: &Path) -> Result<()>
Load all plugins from the configured paths.
Sourcepub fn load_plugin(&mut self, path: &Path) -> Result<()>
pub fn load_plugin(&mut self, path: &Path) -> Result<()>
Load a specific plugin by name or path.
Sourcepub fn run_hook(
&mut self,
event: HookEvent,
ctx: &PluginContext,
) -> Result<HookResult>
pub fn run_hook( &mut self, event: HookEvent, ctx: &PluginContext, ) -> Result<HookResult>
Run hooks for an event.
Sourcepub fn run_command(&mut self, name: &str, args: &[String]) -> Result<i32>
pub fn run_command(&mut self, name: &str, args: &[String]) -> Result<i32>
Run a custom command.
Sourcepub fn commands(&self) -> &HashMap<String, CustomCommand>
pub fn commands(&self) -> &HashMap<String, CustomCommand>
Get the list of registered custom commands.
Sourcepub fn config(&self) -> &PluginConfig
pub fn config(&self) -> &PluginConfig
Get the plugin configuration.
Sourcepub fn has_command(&self, name: &str) -> bool
pub fn has_command(&self, name: &str) -> bool
Check if a command is registered.
Auto Trait Implementations§
impl !RefUnwindSafe for PluginManager
impl !Send for PluginManager
impl !Sync for PluginManager
impl !UnwindSafe for PluginManager
impl Freeze for PluginManager
impl Unpin for PluginManager
impl UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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