PluggableComponent

Trait PluggableComponent 

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

Source

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

Initialize the component with configuration

Source

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

Start the component (transition to active state)

Source

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

Stop the component (graceful shutdown)

Source

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

Pause the component (temporary suspension)

Source

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

Resume the component from paused state

Source

fn component_id(&self) -> &str

Get component identifier

Source

fn component_type(&self) -> &str

Get component type name

Source

fn version(&self) -> &str

Get component version

Source

fn current_state(&self) -> ComponentState

Get current component state

Source

fn health_check(&self) -> SklResult<HealthStatus>

Check if component is healthy

Source

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

Get component capabilities

Source

fn dependencies(&self) -> Vec<ComponentDependency>

Get component dependencies

Source

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

Validate component configuration

Source

fn get_metrics(&self) -> ComponentMetrics

Get component metrics

Source

fn handle_event(&mut self, event: &ComponentEvent) -> SklResult<()>

Handle component events

Source

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

Clone the component (for factory pattern)

Source

fn as_any(&self) -> &dyn Any

Downcast to concrete type

Source

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

Mutable downcast to concrete type

Implementors§