Crate Index
EnerOS consists of 56 Rust crates divided into 10 functional categories. All crates share the unified types and error model provided by eneros-core, ensuring cross-module type consistency and zero-copy transfer. The entire project is organized as a Cargo workspace with a single version number (currently 0.47.0) released in unison, avoiding submodule version drift.
Design Principles
EnerOS’s crate partitioning follows these principles:
- Single Responsibility: Each crate handles only one clear domain, facilitating independent testing and replacement
- Unidirectional Dependencies: Dependencies flow only from upper to lower layers; circular dependencies are forbidden, and compilation order is deterministic
- Zero-Copy Transfer: Cross-crate data transfer uses
Arc<T> / &T, avoiding serialization overhead
- Feature Granularity: Each crate exposes optional capabilities through Cargo features, enabled on demand to reduce binary size
- Tiered Stability: Core layer APIs are marked
stable, power kernel marked beta, application layer marked experimental
Category Overview
| Category | Count | Key Crates | Description |
|---|
| Core Layer | 2 | eneros-core, eneros-linalg | Unified types, sparse linear algebra |
| Power Kernel | 7 | eneros-topology, eneros-powerflow | Topology, Load Flow, Constraint, equipment, time series, event bus |
| Agent Runtime | 5 | eneros-agent, eneros-reasoning | Agent, memory, tools, reasoning, AI |
| Infrastructure | 8 | eneros-os, eneros-gateway | OS, gateway, devices, SCADA, network, bridge, runtime, performance |
| Protocol Adapters | 8 | eneros-protocol-iec104, eneros-protocol-mqtt | IEC 61850/104/103, CDT, CoAP, DL/T 698, ICCP, LwM2M, MQTT, PMU |
| Analytics | 4 | eneros-analysis, eneros-twin | State estimation/OPF/short circuit, EMTP, Digital Twin, simulator |
| Security | 4 | eneros-trust, eneros-audit | Zero Trust, IDS, audit, compliance |
| Operations | 5 | eneros-slo, eneros-aiops | SLO, AIOps, ops, multi-region, Multi-tenant |
| Visualization | 4 | eneros-dashboard, eneros-3d | Dashboard, 3D, natural language, reports |
| i18n & Plugins | 9 | eneros-i18n, eneros-plugin | i18n, Plugin, SDK, edge, IoT Hub, GraphQL, API, testing tools |
A total of 56 crates, with category counts matching the release manifest.
Dependency Graph Overview
┌─────────────────────────────────────────────────────────────┐
│ Application Layer │
│ eneros-dashboard eneros-api eneros-edge eneros-3d │
└─────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────┐
│ Agent Runtime │
│ eneros-agent → memory / tool / reasoning / ai │
└─────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────┐
│ Power-Native Kernel │
│ topology → powerflow → constraint → equipment → timeseries │
│ eventbus │
└─────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────┐
│ Core Layer │
│ eneros-core (unified types) eneros-linalg (sparse matrix)│
└─────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────┐
│ Infrastructure │
│ eneros-os eneros-gateway eneros-device eneros-scada │
│ eneros-trust eneros-audit eneros-ids eneros-compliance │
└─────────────────────────────────────────────────────────────┘
Dependencies flow strictly top-down; lower layers are unaware of upper layers. For the detailed dependency matrix, see the Crate Dependencies page.
Core Crate Details
The table below lists the 10 most critical crates of EnerOS, corresponding to the 10 documents that follow in this chapter:
| Crate | Category | Responsibility | Documentation |
|---|
eneros-core | Core Layer | Unified types, error model, global configuration | View |
eneros-topology | Power Kernel | Grid topology graph modeling and analysis | View |
eneros-powerflow | Power Kernel | Newton-Raphson Load Flow solver | View |
eneros-constraint | Power Kernel | Safety constraint validation and feasibility projection | View |
eneros-agent | Agent Runtime | Agent lifecycle and multi-agent collaboration | View |
eneros-gateway | Infrastructure | Safety gateway, command execution, decision pipeline | View |
eneros-api | i18n & Plugins | REST/GraphQL/WebSocket/SSE API services | View |
eneros-dashboard | Visualization | Web dashboard + PWA | View |
eneros-twin | Analytics | Digital Twin engine and What-If analysis | View |
eneros-trust | Security | Zero Trust, mTLS, certificate rotation | View |
Complete Crate List
Core Layer (2)
| Crate | Responsibility | Key Types |
|---|
eneros-core | Unified types, errors, configuration | EnerOSError, EnerOSConfig, ElementId |
eneros-linalg | Sparse linear algebra | SparseMatrix, CsrMatrix, LU, Cholesky |
Power Kernel (7)
| Crate | Responsibility | Key Types |
|---|
eneros-topology | Grid topology graph modeling and analysis | NetworkGraph, TopologyEngine, Island |
eneros-powerflow | Newton-Raphson Load Flow solver | PowerFlowSolver, YBusMatrix, PowerFlowResult |
eneros-constraint | Safety constraint validation and feasibility projection | ConstraintEngine, Violation, FeasibilityProjector |
eneros-equipment | Equipment parameter model library | EquipmentLibrary, TransformerModel, LineModel |
eneros-cnpower | Chinese distribution network primary equipment parameter library + compliance checker | CnEquipmentLibrary, ComplianceChecker |
eneros-timeseries | Time series data storage and query (SQLite persistence) | TimeSeriesEngine, Point, Query |
eneros-eventbus | Event-driven communication bus | EventBus, Subscription, Event |
Agent Runtime (5)
| Crate | Responsibility | Key Types |
|---|
eneros-agent | Agent runtime and domain Agents | Agent, AgentContext, Orchestrator |
eneros-memory | Agent memory system | MemoryStore, EpisodicMemory, SemanticMemory |
eneros-tool | Agent tool engine | ToolRegistry, Tool, ToolResult |
eneros-reasoning | Reasoning engine (LLM + rig integration) | ReasoningEngine, Chain, Prompt |
eneros-ai | AI/ML integration foundation | ModelRegistry, InferenceEngine |
Infrastructure (8)
| Crate | Responsibility | Key Types |
|---|
eneros-os | OS service layer | OsService, ProcessSupervisor |
eneros-gateway | Safety gateway, command execution, decision pipeline | SafetyGateway, Command, Action |
eneros-device | Device communication and protocol adaptation | DeviceManager, DeviceChannel |
eneros-scada | SCADA data acquisition (IEC 104 integration) | ScadaGateway, DataPoint |
eneros-network | Topology-Power Flow unified pipeline | NetworkPipeline, PipelineStage |
eneros-bridge | Python bridge (cnpower/pandapower) | PythonBridge, PyHandle |
eneros-runtime | Architecture runtime | RuntimeContext, RuntimeHandle |
eneros-perf | Performance optimization (arena/pool/ring_buffer) | Arena, Pool, RingBuffer |
Protocol Adapters (8)
| Crate | Responsibility | Standard |
|---|
eneros-protocol-cdt | CDT cyclic telecontrol protocol | DL/T 634 ministerial regulation |
eneros-protocol-coap | CoAP | RFC 7252 |
eneros-protocol-dlt698 | DL/T 698.45 + DL/T 645 | DL/T 698 / DL/T 645 |
eneros-protocol-iccp | ICCP/TASE.2 | IEC 60870-6 |
eneros-protocol-iec103 | IEC 60870-5-103 | IEC 60870-5-103 |
eneros-protocol-lwm2m | LwM2M 1.1 | OMA LwM2M 1.1 |
eneros-protocol-mqtt | MQTT 5.0 built-in broker | MQTT 5.0 |
eneros-protocol-pmu | PMU/PDC | IEEE C37.118 |
Analytics (4)
| Crate | Responsibility | Key Types |
|---|
eneros-analysis | State estimation/OPF/short circuit | StateEstimator, OpfSolver, FaultAnalyzer |
eneros-emtp | Electromagnetic transient simulation | EmtpSolver, EmtpNetwork |
eneros-twin | Digital Twin engine | TwinModel, WhatIfEngine, HistoryReplay |
eneros-simulator | Scenario script engine and simulator | Scenario, Simulator |
Security (4)
| Crate | Responsibility | Key Types |
|---|
eneros-trust | Zero Trust (internal CA + mTLS + certificate rotation) | CaManager, CertManager, MtlsAcceptor |
eneros-ids | Intrusion detection | IdsEngine, Signature, AnomalyDetector |
eneros-audit | Unified audit (HMAC signature + chained hash + WORM) | AuditChain, AuditEntry |
eneros-compliance | Compliance automation | ComplianceChecker, Rule |
Operations (5)
| Crate | Responsibility | Key Types |
|---|
eneros-slo | SLO/SLI + error budget | Slo, Sli, ErrorBudget |
eneros-aiops | AIOps (alarm clustering/root cause analysis/event aggregation) | AlarmCluster, RootCauseAnalyzer |
eneros-ops | Operations automation | OpsPipeline, Runbook |
eneros-multiregion | Multi-region High Availability | RegionRegistry, FailoverPolicy |
eneros-tenant | Multi-tenant isolation | TenantManager, TenantId |
Visualization (4)
| Crate | Responsibility | Key Types |
|---|
eneros-dashboard | Web dashboard + PWA | DashboardServer, DashboardDef, WidgetDef |
eneros-3d | 3D scene and glTF 2.0 export | Scene3D, GltfExporter |
eneros-nl | Natural language query engine | NlQueryEngine, IntentParser |
eneros-report | Reports and export | ReportGenerator, Template |
i18n & Plugins (9)
| Crate | Responsibility | Key Types |
|---|
eneros-i18n | Multilingual translation framework (Fluent + BCP 47) | I18nBundle, Locale |
eneros-plugin | Plugin framework (Ed25519 signing + seccomp sandbox) | PluginHost, PluginManifest |
eneros-plugin-macros | Plugin procedural macros | plugin_export! |
eneros-sdk | Development SDK | SdkClient, SdkBuilder |
eneros-edge | Edge computing | EdgeNode, EdgeAgent |
eneros-iot-hub | Sensor network aggregation | IoTHub, SensorNode |
eneros-graphql | GraphQL API | GraphQLSchema, QueryRoot |
eneros-api | CLI / HTTP API services | ApiServer, ApiClient, Cli |
eneros-test-utils | Testing tools and chaos engineering | TestHarness, ChaosMonkey |
Cargo Workspace Organization
EnerOS uses a single Cargo workspace to manage all 56 crates. The root Cargo.toml excerpt is as follows:
[workspace]
resolver = "2"
members = [
"crates/core",
"crates/linalg",
"crates/topology",
"crates/powerflow",
"crates/constraint",
"crates/equipment",
"crates/cnpower",
"crates/timeseries",
"crates/eventbus",
"crates/agent",
"crates/memory",
"crates/tool",
"crates/reasoning",
"crates/ai",
"crates/os",
"crates/gateway",
"crates/device",
"crates/scada",
"crates/network",
"crates/bridge",
"crates/runtime",
"crates/perf",
"crates/protocol-cdt",
"crates/protocol-coap",
"crates/protocol-dlt698",
"crates/protocol-iccp",
"crates/protocol-iec103",
"crates/protocol-lwm2m",
"crates/protocol-mqtt",
"crates/protocol-pmu",
"crates/analysis",
"crates/emtp",
"crates/twin",
"crates/simulator",
"crates/trust",
"crates/ids",
"crates/audit",
"crates/compliance",
"crates/slo",
"crates/aiops",
"crates/ops",
"crates/multiregion",
"crates/tenant",
"crates/dashboard",
"crates/3d",
"crates/nl",
"crates/report",
"crates/i18n",
"crates/plugin",
"crates/plugin-macros",
"crates/sdk",
"crates/edge",
"crates/iot-hub",
"crates/graphql",
"crates/api",
"crates/test-utils",
]
[workspace.package]
version = "0.47.0"
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/Gawg-AI/EnerOS"
[workspace.dependencies]
eneros-core = { path = "crates/core", version = "0.47.0" }
eneros-linalg = { path = "crates/linalg", version = "0.47.0" }
eneros-topology = { path = "crates/topology", version = "0.47.0" }
serde = { version = "1.0", features = ["derive"] }
tokio = { version = "1", features = ["full"] }
tracing = "0.1"
thiserror = "1.0"
Crate Selection Guide
| If you want to… | Recommended entry crate |
|---|
| Create custom Agent | eneros-agent + eneros-tool + eneros-reasoning |
| Trigger Load Flow calculation | eneros-powerflow or eneros-api HTTP endpoint |
| Validate command safety | eneros-constraint + eneros-gateway |
| Connect IEC 104 devices | eneros-protocol-iec103 and eneros-scada |
| Build monitoring dashboard | eneros-dashboard + eneros-timeseries |
| Ingest PMU data stream | eneros-protocol-pmu + eneros-twin |
| Multi-tenant SaaS transformation | eneros-tenant + eneros-multiregion |
| Compliance audit | eneros-audit + eneros-compliance |
| Natural language query | eneros-nl + eneros-graphql |
| Edge deployment | eneros-edge + eneros-protocol-mqtt |
Version and Compatibility
All EnerOS crates share the 0.47.0 version number, following semantic versioning:
0.x.0: Minor versions released quarterly, allowing API breaking changes; migration guides provided with release notes
0.47.x: Patch versions released weekly, containing only bugfixes and non-breaking new APIs
- LTS versions: Released annually, providing 3 years of security updates
Compatibility matrix:
| EnerOS Version | Minimum Rust Version | Operating System |
|---|
| 0.47.x | 1.78 | Linux / macOS / Windows |
| 0.46.x | 1.75 | Linux / macOS / Windows |
| 0.45.x (LTS) | 1.72 | Linux / macOS |
EnerOS end-to-end performance under standard test environment (4 cores / 8GB / Ubuntu 22.04):
| Operation | Latency | Crates Involved |
|---|
| Topology analysis (1000 nodes) | < 1ms | eneros-topology |
| Load Flow calculation (IEEE 14-bus) | < 12ms | eneros-powerflow |
| Constraint validation (single command) | < 10μs | eneros-constraint |
| Time series write | < 1μs | eneros-timeseries |
| Event bus broadcast | < 10μs | eneros-eventbus |
| Agent command dispatch | < 100μs | eneros-agent + eneros-gateway |
| Real-time domain response (protection logic) | < 100μs | eneros-os |