nerve/
lib.rs

1//! Nerve Framework - In-Process Reactive System
2//!
3//! A high-performance, in-process reactive system with Quality of Service (QoS) guarantees
4//! for message passing and component coordination.
5//!
6//! # Core Features
7//! - QoS-based message buffering
8//! - Thread lifecycle management
9//! - Pub/sub communication patterns
10//! - Real-time performance monitoring
11//!
12//! # Namespace Structure
13//! ```
14//! nerve::
15//! ├── core::         // Core traits, types, and errors
16//! ├── memory::       // Memory management and optimization
17//! ├── thread::       // Thread lifecycle and coordination
18//! ├── node::         // Node registry and discovery
19//! ├── communication::// Message routing and protocols
20//! ├── cache::        // Multi-level caching system
21//! ├── protocols::    // Communication protocols
22//! └── system::       // System integration and management
23//! ```
24//!
25//! # Quick Start
26//! ```rust
27//! use nerve::prelude::*;
28//! use nerve::memory::buffers::QoSBuffer;
29//! use nerve::communication::routers::array_trie::ArrayTrieRouter;
30//! use nerve::thread::lifecycle::ThreadState;
31//!
32//! // Create a QoS-aware buffer
33//! let mut buffer = QoSBuffer::new(100, QoS::BestEffort).unwrap();
34//! buffer.push("Message").unwrap();
35//!
36//! // Create a high-performance router
37//! let router = ArrayTrieRouter::new();
38//! ```
39
40#![warn(missing_docs)]
41#![warn(clippy::all)]
42#![warn(clippy::pedantic)]
43#![allow(clippy::module_name_repetitions)]
44
45// Core framework modules
46pub mod core;
47pub mod memory;
48pub mod thread;
49pub mod node;
50pub mod communication;
51pub mod cache;
52pub mod protocols;
53pub mod system;
54
55// Legacy modules (to be migrated)
56pub mod error;
57pub mod integration;
58pub mod cli;
59
60/// Prelude module for convenient imports
61pub mod prelude {
62    // Core types and traits
63    pub use nerve_core_types::{BufferMode, ComponentId, ComponentType, Message, QoS};
64    pub use nerve_core_traits::{MessageBuffer, NerveComponent, NervePlugin};
65
66    // Framework components
67    pub use crate::core::prelude::*;
68
69    // Legacy components (to be migrated)
70    pub use crate::error::Error;
71    pub use crate::integration::{NerveSystem, PluginNerveSystem};
72    pub use crate::cli::CliApp;
73}
74
75#[cfg(test)]
76mod tests {
77    
78
79    #[test]
80    fn test_library_compilation() {
81        // Basic compilation test
82        assert!(true);
83    }
84}