pub struct PluginRegistry { /* private fields */ }Expand description
Plugin registry for managing loaded plugins
Implementations§
Source§impl PluginRegistry
impl PluginRegistry
pub fn new() -> Self
Sourcepub fn load_plugin<P: AsRef<Path>>(
&mut self,
plugin_path: P,
) -> Result<(), PluginError>
pub fn load_plugin<P: AsRef<Path>>( &mut self, plugin_path: P, ) -> Result<(), PluginError>
Load a plugin from a directory
Sourcepub fn get_component(&self, component_type: &str) -> Option<&PluginComponent>
pub fn get_component(&self, component_type: &str) -> Option<&PluginComponent>
Get a component by type
Sourcepub fn render_component(
&self,
component_type: &str,
context: &PluginContext,
config: &ComponentConfig,
) -> Result<String, PluginError>
pub fn render_component( &self, component_type: &str, context: &PluginContext, config: &ComponentConfig, ) -> Result<String, PluginError>
Render a plugin component
Sourcepub fn handle_event(
&self,
component_type: &str,
context: &PluginContext,
event: &PluginEvent,
) -> Result<(), PluginError>
pub fn handle_event( &self, component_type: &str, context: &PluginContext, event: &PluginEvent, ) -> Result<(), PluginError>
Handle plugin events
Sourcepub fn list_plugins(&self) -> Vec<&PluginManifest>
pub fn list_plugins(&self) -> Vec<&PluginManifest>
List loaded plugins
Sourcepub fn unload_plugin(&mut self, plugin_name: &str) -> Result<(), PluginError>
pub fn unload_plugin(&mut self, plugin_name: &str) -> Result<(), PluginError>
Unload a plugin
pub fn load_manifest<P: AsRef<Path>>( &self, manifest_path: P, ) -> Result<PluginManifest, PluginError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PluginRegistry
impl RefUnwindSafe for PluginRegistry
impl Send for PluginRegistry
impl Sync for PluginRegistry
impl Unpin for PluginRegistry
impl UnwindSafe for PluginRegistry
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.