PluginComponent

Trait PluginComponent 

Source
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§

Source

fn component_type(&self) -> &str

Get component type

Source

fn config(&self) -> &ComponentConfig

Get component configuration

Source

fn initialize(&mut self, context: &ComponentContext) -> SklResult<()>

Initialize component

Source

fn clone_component(&self) -> Box<dyn PluginComponent>

Clone the component

Source

fn as_any(&self) -> &dyn Any

Convert to Any for downcasting

Source

fn as_any_mut(&mut self) -> &mut dyn Any

Convert to mutable Any for downcasting

Implementors§