pub struct PluginRuntime { /* private fields */ }Expand description
Plugin runtime for managing plugins.
Implementations§
Source§impl PluginRuntime
impl PluginRuntime
Sourcepub fn new(config: RuntimeConfig) -> Result<Self>
pub fn new(config: RuntimeConfig) -> Result<Self>
Create a new plugin runtime.
Sourcepub fn default_config() -> Result<Self>
pub fn default_config() -> Result<Self>
Create with default configuration.
Sourcepub fn config(&self) -> &RuntimeConfig
pub fn config(&self) -> &RuntimeConfig
Get the runtime configuration.
Sourcepub fn loader(&self) -> &PluginLoader
pub fn loader(&self) -> &PluginLoader
Get the plugin loader.
Sourcepub fn registry(&self) -> &PluginRegistry
pub fn registry(&self) -> &PluginRegistry
Get the plugin registry.
Sourcepub fn load_manifest(&self, path: impl Into<PathBuf>) -> Result<PluginHandle>
pub fn load_manifest(&self, path: impl Into<PathBuf>) -> Result<PluginHandle>
Load a plugin from a manifest file.
Sourcepub fn load_source(&self, path: impl Into<PathBuf>) -> Result<PluginHandle>
pub fn load_source(&self, path: impl Into<PathBuf>) -> Result<PluginHandle>
Load a plugin from source.
Sourcepub fn load_bytecode(&self, path: impl Into<PathBuf>) -> Result<PluginHandle>
pub fn load_bytecode(&self, path: impl Into<PathBuf>) -> Result<PluginHandle>
Load a plugin from bytecode.
Sourcepub fn get(&self, name: &str) -> Option<PluginHandle>
pub fn get(&self, name: &str) -> Option<PluginHandle>
Get a plugin by name.
Sourcepub fn has_plugin(&self, name: &str) -> bool
pub fn has_plugin(&self, name: &str) -> bool
Check if a plugin is loaded.
Sourcepub fn plugins(&self) -> Vec<PluginHandle>
pub fn plugins(&self) -> Vec<PluginHandle>
Get all loaded plugins.
Sourcepub fn running(&self) -> Vec<PluginHandle>
pub fn running(&self) -> Vec<PluginHandle>
Get running plugins.
Sourcepub fn plugin_count(&self) -> usize
pub fn plugin_count(&self) -> usize
Get plugin count.
Sourcepub fn discover(&self) -> Result<Vec<PluginHandle>>
pub fn discover(&self) -> Result<Vec<PluginHandle>>
Discover and load plugins from configured directories.
Sourcepub fn call(
&self,
plugin_name: &str,
function: &str,
args: &[Value],
) -> Result<Value>
pub fn call( &self, plugin_name: &str, function: &str, args: &[Value], ) -> Result<Value>
Call a function on a plugin.
Trait Implementations§
Source§impl Debug for PluginRuntime
impl Debug for PluginRuntime
Auto Trait Implementations§
impl Freeze for PluginRuntime
impl !RefUnwindSafe for PluginRuntime
impl Send for PluginRuntime
impl Sync for PluginRuntime
impl Unpin for PluginRuntime
impl !UnwindSafe for PluginRuntime
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