pub struct ModuleRuntime { /* private fields */ }
Expand description
Runtime module manager - orchestrates module loading and lifecycle
Implementations§
Source§impl ModuleRuntime
impl ModuleRuntime
Sourcepub fn with_health_config(health_config: HealthCheckConfig) -> Self
pub fn with_health_config(health_config: HealthCheckConfig) -> Self
Create module runtime with custom health check config
Sourcepub fn register_module(
&mut self,
descriptor: ModuleDescriptor,
) -> Result<(), ModuleRuntimeError>
pub fn register_module( &mut self, descriptor: ModuleDescriptor, ) -> Result<(), ModuleRuntimeError>
Register a module for runtime management
Sourcepub fn register_modules(
&mut self,
descriptors: Vec<ModuleDescriptor>,
) -> Result<(), ModuleRuntimeError>
pub fn register_modules( &mut self, descriptors: Vec<ModuleDescriptor>, ) -> Result<(), ModuleRuntimeError>
Register multiple modules
Sourcepub fn add_lifecycle_hook<H: ModuleLifecycleHook + 'static>(
&mut self,
module_name: String,
hook: H,
)
pub fn add_lifecycle_hook<H: ModuleLifecycleHook + 'static>( &mut self, module_name: String, hook: H, )
Add lifecycle hook for a module
Sourcepub fn calculate_load_order(
&mut self,
) -> Result<Vec<String>, ModuleRuntimeError>
pub fn calculate_load_order( &mut self, ) -> Result<Vec<String>, ModuleRuntimeError>
Task 4.1: Implement topological sorting for module initialization order
Sourcepub fn load_order(&self) -> &[String]
pub fn load_order(&self) -> &[String]
Get the current module load order
Sourcepub async fn resolve_dependencies(
&mut self,
container: &mut IocContainer,
) -> Result<(), ModuleRuntimeError>
pub async fn resolve_dependencies( &mut self, container: &mut IocContainer, ) -> Result<(), ModuleRuntimeError>
Task 4.2: Add runtime dependency resolution with clear error reporting
Sourcepub async fn initialize_all_modules(
&mut self,
container: &IocContainer,
) -> Result<(), ModuleRuntimeError>
pub async fn initialize_all_modules( &mut self, container: &IocContainer, ) -> Result<(), ModuleRuntimeError>
Task 4.4: Add module lifecycle hooks (startup, shutdown, health checks)
Sourcepub async fn shutdown_all_modules(&mut self) -> Result<(), ModuleRuntimeError>
pub async fn shutdown_all_modules(&mut self) -> Result<(), ModuleRuntimeError>
Shutdown all modules in reverse order
Sourcepub async fn health_check_all_modules(
&mut self,
) -> Result<HashMap<String, HealthStatus>, ModuleRuntimeError>
pub async fn health_check_all_modules( &mut self, ) -> Result<HashMap<String, HealthStatus>, ModuleRuntimeError>
Run health checks for all modules
Sourcepub fn get_module_info(&self, module_name: &str) -> Option<&ModuleRuntimeInfo>
pub fn get_module_info(&self, module_name: &str) -> Option<&ModuleRuntimeInfo>
Get module runtime information
Sourcepub fn get_all_module_info(&self) -> &HashMap<String, ModuleRuntimeInfo>
pub fn get_all_module_info(&self) -> &HashMap<String, ModuleRuntimeInfo>
Get all module runtime information
Sourcepub fn get_load_order(&self) -> &[String]
pub fn get_load_order(&self) -> &[String]
Get load order
Sourcepub fn get_performance_metrics(&self) -> &ModulePerformanceMetrics
pub fn get_performance_metrics(&self) -> &ModulePerformanceMetrics
Get performance metrics
Sourcepub fn validate_runtime_state(&self) -> Result<(), Vec<ModuleRuntimeError>>
pub fn validate_runtime_state(&self) -> Result<(), Vec<ModuleRuntimeError>>
Validate runtime state
Sourcepub fn get_runtime_statistics(&self) -> ModuleRuntimeStatistics
pub fn get_runtime_statistics(&self) -> ModuleRuntimeStatistics
Get runtime statistics for monitoring
Trait Implementations§
Source§impl Debug for ModuleRuntime
impl Debug for ModuleRuntime
Auto Trait Implementations§
impl Freeze for ModuleRuntime
impl !RefUnwindSafe for ModuleRuntime
impl Send for ModuleRuntime
impl Sync for ModuleRuntime
impl Unpin for ModuleRuntime
impl !UnwindSafe for ModuleRuntime
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more