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// 新的Actor系统模块
47pub mod actors;
48pub use error::{ForgeResult, error_utils};
49pub use error_helpers::{
50    UnwrapHelpers, lock_helpers, collection_helpers, schema_helpers,
51    state_helpers,
52};
53
54// 公共 API 导出
55pub use runtime::async_processor::{
56    AsyncProcessor, ProcessorError, TaskProcessor, TaskResult, TaskStatus,
57};
58pub use runtime::async_runtime::ForgeAsyncRuntime;
59// 新的Actor运行时
60pub use runtime::actor_runtime::ForgeActorRuntime;
61// 运行时统一接口
62pub use runtime::runtime_trait::{RuntimeTrait, RuntimeFactory};
63// 运行时构建器和自适应配置
64pub use runtime::builder::ForgeRuntimeBuilder;
65pub use runtime::system_detector::{SystemResources, ResourceTier};
66pub use runtime::adaptive::AdaptiveRuntimeSelector;
67pub use config::{
68    ForgeConfig, ForgeConfigBuilder, Environment, ProcessorConfig,
69    PerformanceConfig, EventConfig, HistoryConfig, ExtensionConfig,
70    CacheConfig, ConfigValidationError, RuntimeType, RuntimeConfig,
71};
72pub use error::ForgeError;
73pub use event::{Event, EventBus, EventHandler};
74pub use extension::Extension;
75pub use extension_manager::{ExtensionManager, ExtensionManagerBuilder};
76pub use history_manager::{History, HistoryManager};
77pub use runtime::runtime::ForgeRuntime;
78pub use schema_parser::{
79    XmlSchemaParser, XmlSchemaSerializer, XmlSchemaError, XmlSchemaResult,
80};
81pub use runtime::sync_processor::{
82    SyncProcessor, TaskProcessor as SyncTaskProcessor,
83};
84pub use types::*;
85
86// Actor系统相关导出
87pub use actors::{
88    ForgeActorSystem, ActorSystemConfig,
89    transaction_processor::{TransactionMessage, TransactionStats},
90    state_actor::{StateMessage, HistoryInfo, StateSnapshot},
91    event_bus::{EventBusMessage, EventBusStats},
92};