pub struct NerveSystem { /* private fields */ }Expand description
Main system integration structure
Provides unified access to all Nerve Framework components and manages their integration and resource sharing.
Implementations§
Source§impl NerveSystem
impl NerveSystem
Sourcepub fn new() -> SystemResult<Self>
pub fn new() -> SystemResult<Self>
Create a new Nerve System with default configuration
Sourcepub fn with_config(config: SystemConfig) -> SystemResult<Self>
pub fn with_config(config: SystemConfig) -> SystemResult<Self>
Create a new Nerve System with custom configuration
Sourcepub fn get_statistics(&self) -> SystemStatistics
pub fn get_statistics(&self) -> SystemStatistics
Get system performance statistics
Sourcepub fn config(&self) -> &SystemConfig
pub fn config(&self) -> &SystemConfig
Get system configuration
Sourcepub fn memory_pool(&self) -> &Arc<dyn MemoryPool<Vec<u8>>>
pub fn memory_pool(&self) -> &Arc<dyn MemoryPool<Vec<u8>>>
Get memory pool reference
Sourcepub fn message_buffer(&self) -> &Arc<dyn MessageBuffer<Message>>
pub fn message_buffer(&self) -> &Arc<dyn MessageBuffer<Message>>
Get message buffer reference
Sourcepub fn thread_coordinator(&self) -> &Arc<dyn ThreadCoordinator>
pub fn thread_coordinator(&self) -> &Arc<dyn ThreadCoordinator>
Get thread coordinator reference
Sourcepub fn thread_watchdog(&self) -> &Arc<dyn ThreadWatchdog>
pub fn thread_watchdog(&self) -> &Arc<dyn ThreadWatchdog>
Get thread watchdog reference
Sourcepub fn node_registry(&self) -> &Arc<dyn NodeRegistry>
pub fn node_registry(&self) -> &Arc<dyn NodeRegistry>
Get node registry reference
Sourcepub fn message_router(&self) -> &Arc<dyn MessageRouter>
pub fn message_router(&self) -> &Arc<dyn MessageRouter>
Get message router reference
Sourcepub fn subscription_manager(&self) -> &Arc<dyn SubscriptionManager>
pub fn subscription_manager(&self) -> &Arc<dyn SubscriptionManager>
Get subscription manager reference
Sourcepub fn request_response(&self) -> &Arc<dyn RequestResponse>
pub fn request_response(&self) -> &Arc<dyn RequestResponse>
Get request-response protocol handler reference
Sourcepub fn is_healthy(&self) -> bool
pub fn is_healthy(&self) -> bool
Check if system is healthy
Sourcepub fn health_status(&self) -> String
pub fn health_status(&self) -> String
Get system health status
Sourcepub fn reset_statistics(&self)
pub fn reset_statistics(&self)
Reset performance statistics
Sourcepub fn process_message(&self, topic: &str, payload: Vec<u8>) -> SystemResult<()>
pub fn process_message(&self, topic: &str, payload: Vec<u8>) -> SystemResult<()>
Unified message processing - integrated message flow through all components
This demonstrates the integrated message flow through all components:
- Memory allocation from memory pool
- Message creation and storage in buffer
- Thread coordination for processing
- Message routing through communication system
- Delivery to subscribers via publisher
Sourcepub fn get_system_status(&self) -> SystemStatus
pub fn get_system_status(&self) -> SystemStatus
Get system status with integrated component health
Sourcepub fn shutdown(self) -> SystemResult<()>
pub fn shutdown(self) -> SystemResult<()>
Shutdown the system gracefully