Plugin

Trait Plugin 

Source
pub trait Plugin:
    Send
    + Sync
    + Debug {
    // Required methods
    fn metadata(&self) -> &PluginMetadata;
    fn initialize(&mut self, context: &PluginContext) -> SklResult<()>;
    fn shutdown(&mut self) -> SklResult<()>;
    fn capabilities(&self) -> Vec<PluginCapability>;
    fn create_component(
        &self,
        component_type: &str,
        config: &ComponentConfig,
    ) -> SklResult<Box<dyn PluginComponent>>;
    fn validate_config(&self, config: &ComponentConfig) -> SklResult<()>;
    fn get_component_schema(
        &self,
        component_type: &str,
    ) -> Option<ComponentSchema>;
}
Expand description

Base trait for all plugins

Required Methods§

Source

fn metadata(&self) -> &PluginMetadata

Get plugin metadata

Source

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

Initialize the plugin

Source

fn shutdown(&mut self) -> SklResult<()>

Shutdown the plugin

Source

fn capabilities(&self) -> Vec<PluginCapability>

Get plugin capabilities

Source

fn create_component( &self, component_type: &str, config: &ComponentConfig, ) -> SklResult<Box<dyn PluginComponent>>

Create a component instance

Source

fn validate_config(&self, config: &ComponentConfig) -> SklResult<()>

Validate plugin configuration

Source

fn get_component_schema(&self, component_type: &str) -> Option<ComponentSchema>

Get component schema for validation

Implementors§