Skip to main content

Crate Index

Crate Index

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

CategoryCountKey CratesDescription
Core Layer2eneros-core, eneros-linalgUnified types, sparse linear algebra
Power Kernel7eneros-topology, eneros-powerflowTopology, Load Flow, Constraint, equipment, time series, event bus
Agent Runtime5eneros-agent, eneros-reasoningAgent, memory, tools, reasoning, AI
Infrastructure8eneros-os, eneros-gatewayOS, gateway, devices, SCADA, network, bridge, runtime, performance
Protocol Adapters8eneros-protocol-iec104, eneros-protocol-mqttIEC 61850/104/103, CDT, CoAP, DL/T 698, ICCP, LwM2M, MQTT, PMU
Analytics4eneros-analysis, eneros-twinState estimation/OPF/short circuit, EMTP, Digital Twin, simulator
Security4eneros-trust, eneros-auditZero Trust, IDS, audit, compliance
Operations5eneros-slo, eneros-aiopsSLO, AIOps, ops, multi-region, Multi-tenant
Visualization4eneros-dashboard, eneros-3dDashboard, 3D, natural language, reports
i18n & Plugins9eneros-i18n, eneros-plugini18n, 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:

CrateCategoryResponsibilityDocumentation
eneros-coreCore LayerUnified types, error model, global configurationView
eneros-topologyPower KernelGrid topology graph modeling and analysisView
eneros-powerflowPower KernelNewton-Raphson Load Flow solverView
eneros-constraintPower KernelSafety constraint validation and feasibility projectionView
eneros-agentAgent RuntimeAgent lifecycle and multi-agent collaborationView
eneros-gatewayInfrastructureSafety gateway, command execution, decision pipelineView
eneros-apii18n & PluginsREST/GraphQL/WebSocket/SSE API servicesView
eneros-dashboardVisualizationWeb dashboard + PWAView
eneros-twinAnalyticsDigital Twin engine and What-If analysisView
eneros-trustSecurityZero Trust, mTLS, certificate rotationView

Complete Crate List

Core Layer (2)

CrateResponsibilityKey Types
eneros-coreUnified types, errors, configurationEnerOSError, EnerOSConfig, ElementId
eneros-linalgSparse linear algebraSparseMatrix, CsrMatrix, LU, Cholesky

Power Kernel (7)

CrateResponsibilityKey Types
eneros-topologyGrid topology graph modeling and analysisNetworkGraph, TopologyEngine, Island
eneros-powerflowNewton-Raphson Load Flow solverPowerFlowSolver, YBusMatrix, PowerFlowResult
eneros-constraintSafety constraint validation and feasibility projectionConstraintEngine, Violation, FeasibilityProjector
eneros-equipmentEquipment parameter model libraryEquipmentLibrary, TransformerModel, LineModel
eneros-cnpowerChinese distribution network primary equipment parameter library + compliance checkerCnEquipmentLibrary, ComplianceChecker
eneros-timeseriesTime series data storage and query (SQLite persistence)TimeSeriesEngine, Point, Query
eneros-eventbusEvent-driven communication busEventBus, Subscription, Event

Agent Runtime (5)

CrateResponsibilityKey Types
eneros-agentAgent runtime and domain AgentsAgent, AgentContext, Orchestrator
eneros-memoryAgent memory systemMemoryStore, EpisodicMemory, SemanticMemory
eneros-toolAgent tool engineToolRegistry, Tool, ToolResult
eneros-reasoningReasoning engine (LLM + rig integration)ReasoningEngine, Chain, Prompt
eneros-aiAI/ML integration foundationModelRegistry, InferenceEngine

Infrastructure (8)

CrateResponsibilityKey Types
eneros-osOS service layerOsService, ProcessSupervisor
eneros-gatewaySafety gateway, command execution, decision pipelineSafetyGateway, Command, Action
eneros-deviceDevice communication and protocol adaptationDeviceManager, DeviceChannel
eneros-scadaSCADA data acquisition (IEC 104 integration)ScadaGateway, DataPoint
eneros-networkTopology-Power Flow unified pipelineNetworkPipeline, PipelineStage
eneros-bridgePython bridge (cnpower/pandapower)PythonBridge, PyHandle
eneros-runtimeArchitecture runtimeRuntimeContext, RuntimeHandle
eneros-perfPerformance optimization (arena/pool/ring_buffer)Arena, Pool, RingBuffer

Protocol Adapters (8)

CrateResponsibilityStandard
eneros-protocol-cdtCDT cyclic telecontrol protocolDL/T 634 ministerial regulation
eneros-protocol-coapCoAPRFC 7252
eneros-protocol-dlt698DL/T 698.45 + DL/T 645DL/T 698 / DL/T 645
eneros-protocol-iccpICCP/TASE.2IEC 60870-6
eneros-protocol-iec103IEC 60870-5-103IEC 60870-5-103
eneros-protocol-lwm2mLwM2M 1.1OMA LwM2M 1.1
eneros-protocol-mqttMQTT 5.0 built-in brokerMQTT 5.0
eneros-protocol-pmuPMU/PDCIEEE C37.118

Analytics (4)

CrateResponsibilityKey Types
eneros-analysisState estimation/OPF/short circuitStateEstimator, OpfSolver, FaultAnalyzer
eneros-emtpElectromagnetic transient simulationEmtpSolver, EmtpNetwork
eneros-twinDigital Twin engineTwinModel, WhatIfEngine, HistoryReplay
eneros-simulatorScenario script engine and simulatorScenario, Simulator

Security (4)

CrateResponsibilityKey Types
eneros-trustZero Trust (internal CA + mTLS + certificate rotation)CaManager, CertManager, MtlsAcceptor
eneros-idsIntrusion detectionIdsEngine, Signature, AnomalyDetector
eneros-auditUnified audit (HMAC signature + chained hash + WORM)AuditChain, AuditEntry
eneros-complianceCompliance automationComplianceChecker, Rule

Operations (5)

CrateResponsibilityKey Types
eneros-sloSLO/SLI + error budgetSlo, Sli, ErrorBudget
eneros-aiopsAIOps (alarm clustering/root cause analysis/event aggregation)AlarmCluster, RootCauseAnalyzer
eneros-opsOperations automationOpsPipeline, Runbook
eneros-multiregionMulti-region High AvailabilityRegionRegistry, FailoverPolicy
eneros-tenantMulti-tenant isolationTenantManager, TenantId

Visualization (4)

CrateResponsibilityKey Types
eneros-dashboardWeb dashboard + PWADashboardServer, DashboardDef, WidgetDef
eneros-3d3D scene and glTF 2.0 exportScene3D, GltfExporter
eneros-nlNatural language query engineNlQueryEngine, IntentParser
eneros-reportReports and exportReportGenerator, Template

i18n & Plugins (9)

CrateResponsibilityKey Types
eneros-i18nMultilingual translation framework (Fluent + BCP 47)I18nBundle, Locale
eneros-pluginPlugin framework (Ed25519 signing + seccomp sandbox)PluginHost, PluginManifest
eneros-plugin-macrosPlugin procedural macrosplugin_export!
eneros-sdkDevelopment SDKSdkClient, SdkBuilder
eneros-edgeEdge computingEdgeNode, EdgeAgent
eneros-iot-hubSensor network aggregationIoTHub, SensorNode
eneros-graphqlGraphQL APIGraphQLSchema, QueryRoot
eneros-apiCLI / HTTP API servicesApiServer, ApiClient, Cli
eneros-test-utilsTesting tools and chaos engineeringTestHarness, 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 Agenteneros-agent + eneros-tool + eneros-reasoning
Trigger Load Flow calculationeneros-powerflow or eneros-api HTTP endpoint
Validate command safetyeneros-constraint + eneros-gateway
Connect IEC 104 deviceseneros-protocol-iec103 and eneros-scada
Build monitoring dashboardeneros-dashboard + eneros-timeseries
Ingest PMU data streameneros-protocol-pmu + eneros-twin
Multi-tenant SaaS transformationeneros-tenant + eneros-multiregion
Compliance auditeneros-audit + eneros-compliance
Natural language queryeneros-nl + eneros-graphql
Edge deploymenteneros-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 VersionMinimum Rust VersionOperating System
0.47.x1.78Linux / macOS / Windows
0.46.x1.75Linux / macOS / Windows
0.45.x (LTS)1.72Linux / macOS

Performance Overview

EnerOS end-to-end performance under standard test environment (4 cores / 8GB / Ubuntu 22.04):

OperationLatencyCrates Involved
Topology analysis (1000 nodes)< 1mseneros-topology
Load Flow calculation (IEEE 14-bus)< 12mseneros-powerflow
Constraint validation (single command)< 10μseneros-constraint
Time series write< 1μseneros-timeseries
Event bus broadcast< 10μseneros-eventbus
Agent command dispatch< 100μseneros-agent + eneros-gateway
Real-time domain response (protection logic)< 100μseneros-os