mf_core/
lib.rs

1//! ModuForge-RS 核心模块
2//!
3//! 该模块提供了框架的核心功能,包括:
4//! - 异步处理器和运行时
5//! - 事件系统
6//! - 扩展机制
7//! - 流程控制
8//! - 错误处理
9//! - 历史记录管理
10//! - 中间件支持
11//! - 节点系统
12//! - 类型定义
13//!
14//! 主要组件:
15//! - `async_processor`: 异步任务处理器
16//! - `async_runtime`: 异步运行时环境
17//! - `error`: 错误类型和处理
18//! - `event`: 事件系统
19//! - `extension`: 扩展机制
20//! - `flow`: 流程控制
21//! - `history_manager`: 历史记录管理
22//! - `middleware`: 中间件支持
23//! - `node`: 节点系统
24//! - `types`: 核心类型定义
25
26pub mod config;
27pub mod debug;
28pub mod error;
29pub mod error_helpers;
30pub mod event;
31pub mod extension;
32pub mod extension_manager;
33pub mod helpers;
34pub mod history_manager;
35#[cfg(test)]
36pub mod test_helpers;
37
38pub mod mark;
39pub mod metrics;
40pub mod middleware;
41pub mod node;
42pub mod runtime;
43pub mod schema_parser;
44pub mod types;
45
46// 追踪初始化模块(开发环境专用)
47pub mod tracing_init;
48
49// 新的Actor系统模块
50pub mod actors;
51pub use error::{ForgeResult, error_utils};
52pub use error_helpers::{
53    UnwrapHelpers, lock_helpers, collection_helpers, schema_helpers,
54    state_helpers,
55};
56
57// 公共 API 导出
58pub use runtime::async_processor::{
59    AsyncProcessor, ProcessorError, TaskProcessor, TaskResult, TaskStatus,
60};
61pub use runtime::async_runtime::ForgeAsyncRuntime;
62// 新的Actor运行时
63pub use runtime::actor_runtime::ForgeActorRuntime;
64// 运行时统一接口
65pub use runtime::runtime_trait::{RuntimeTrait};
66// 运行时构建器和自适应配置
67pub use runtime::builder::{ForgeRuntimeBuilder, AnyRuntime};
68pub use runtime::system_detector::{SystemResources, ResourceTier};
69pub use runtime::adaptive::AdaptiveRuntimeSelector;
70pub use config::{
71    ForgeConfig, ForgeConfigBuilder, Environment, ProcessorConfig,
72    PerformanceConfig, EventConfig, HistoryConfig, ExtensionConfig,
73    CacheConfig, ConfigValidationError, RuntimeType, RuntimeConfig,
74};
75pub use error::ForgeError;
76pub use event::{Event, EventBus, EventHandler};
77pub use extension::Extension;
78pub use extension_manager::{ExtensionManager, ExtensionManagerBuilder};
79pub use history_manager::{History, HistoryManager};
80pub use runtime::runtime::ForgeRuntime;
81pub use schema_parser::{
82    XmlSchemaParser, XmlSchemaSerializer, XmlSchemaError, XmlSchemaResult,
83};
84pub use runtime::sync_processor::{
85    SyncProcessor, TaskProcessor as SyncTaskProcessor,
86};
87pub use types::*;
88
89// Actor系统相关导出
90pub use actors::{
91    ForgeActorSystem, ActorSystemConfig,
92    transaction_processor::{TransactionMessage, TransactionStats},
93    state_actor::{StateMessage, HistoryInfo, StateSnapshot},
94    event_bus::{EventBusMessage, EventBusStats},
95};