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§
Sourcefn metadata(&self) -> &PluginMetadata
fn metadata(&self) -> &PluginMetadata
Get plugin metadata
Sourcefn initialize(&mut self, context: &PluginContext) -> SklResult<()>
fn initialize(&mut self, context: &PluginContext) -> SklResult<()>
Initialize the plugin
Sourcefn capabilities(&self) -> Vec<PluginCapability>
fn capabilities(&self) -> Vec<PluginCapability>
Get plugin capabilities
Sourcefn create_component(
&self,
component_type: &str,
config: &ComponentConfig,
) -> SklResult<Box<dyn PluginComponent>>
fn create_component( &self, component_type: &str, config: &ComponentConfig, ) -> SklResult<Box<dyn PluginComponent>>
Create a component instance
Sourcefn validate_config(&self, config: &ComponentConfig) -> SklResult<()>
fn validate_config(&self, config: &ComponentConfig) -> SklResult<()>
Validate plugin configuration
Sourcefn get_component_schema(&self, component_type: &str) -> Option<ComponentSchema>
fn get_component_schema(&self, component_type: &str) -> Option<ComponentSchema>
Get component schema for validation