pub trait PluginComponent:
Send
+ Sync
+ Debug {
// Required methods
fn component_type(&self) -> &str;
fn config(&self) -> &ComponentConfig;
fn initialize(&mut self, context: &ComponentContext) -> SklResult<()>;
fn clone_component(&self) -> Box<dyn PluginComponent>;
fn as_any(&self) -> &dyn Any;
fn as_any_mut(&mut self) -> &mut dyn Any;
}Expand description
Base trait for plugin components
Required Methods§
Sourcefn component_type(&self) -> &str
fn component_type(&self) -> &str
Get component type
Sourcefn config(&self) -> &ComponentConfig
fn config(&self) -> &ComponentConfig
Get component configuration
Sourcefn initialize(&mut self, context: &ComponentContext) -> SklResult<()>
fn initialize(&mut self, context: &ComponentContext) -> SklResult<()>
Initialize component
Sourcefn clone_component(&self) -> Box<dyn PluginComponent>
fn clone_component(&self) -> Box<dyn PluginComponent>
Clone the component
Sourcefn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
Convert to mutable Any for downcasting