pub trait PluggableComponent:
Send
+ Sync
+ Any {
Show 18 methods
// Required methods
fn initialize(&mut self, config: &ComponentConfig) -> SklResult<()>;
fn start(&mut self) -> SklResult<()>;
fn stop(&mut self) -> SklResult<()>;
fn pause(&mut self) -> SklResult<()>;
fn resume(&mut self) -> SklResult<()>;
fn component_id(&self) -> &str;
fn component_type(&self) -> &str;
fn version(&self) -> &str;
fn current_state(&self) -> ComponentState;
fn health_check(&self) -> SklResult<HealthStatus>;
fn capabilities(&self) -> Vec<ComponentCapability>;
fn dependencies(&self) -> Vec<ComponentDependency>;
fn validate_config(&self, config: &ComponentConfig) -> SklResult<()>;
fn get_metrics(&self) -> ComponentMetrics;
fn handle_event(&mut self, event: &ComponentEvent) -> SklResult<()>;
fn clone_component(&self) -> Box<dyn PluggableComponent>;
fn as_any(&self) -> &dyn Any;
fn as_any_mut(&mut self) -> &mut dyn Any;
}Expand description
Core component trait defining the interface for all modular components
Provides standard lifecycle methods, configuration handling, and capability introspection for components within the modular framework.
Required Methods§
Sourcefn initialize(&mut self, config: &ComponentConfig) -> SklResult<()>
fn initialize(&mut self, config: &ComponentConfig) -> SklResult<()>
Initialize the component with configuration
Sourcefn component_id(&self) -> &str
fn component_id(&self) -> &str
Get component identifier
Sourcefn component_type(&self) -> &str
fn component_type(&self) -> &str
Get component type name
Sourcefn current_state(&self) -> ComponentState
fn current_state(&self) -> ComponentState
Get current component state
Sourcefn health_check(&self) -> SklResult<HealthStatus>
fn health_check(&self) -> SklResult<HealthStatus>
Check if component is healthy
Sourcefn capabilities(&self) -> Vec<ComponentCapability>
fn capabilities(&self) -> Vec<ComponentCapability>
Get component capabilities
Sourcefn dependencies(&self) -> Vec<ComponentDependency>
fn dependencies(&self) -> Vec<ComponentDependency>
Get component dependencies
Sourcefn validate_config(&self, config: &ComponentConfig) -> SklResult<()>
fn validate_config(&self, config: &ComponentConfig) -> SklResult<()>
Validate component configuration
Sourcefn get_metrics(&self) -> ComponentMetrics
fn get_metrics(&self) -> ComponentMetrics
Get component metrics
Sourcefn handle_event(&mut self, event: &ComponentEvent) -> SklResult<()>
fn handle_event(&mut self, event: &ComponentEvent) -> SklResult<()>
Handle component events
Sourcefn clone_component(&self) -> Box<dyn PluggableComponent>
fn clone_component(&self) -> Box<dyn PluggableComponent>
Clone the component (for factory pattern)
Sourcefn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
Mutable downcast to concrete type