Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Crate Layout

Hydra is a multi-crate Rust workspace:

CrateRole
hydra-commonFoundation contracts shared by every engine and application: engine identity, and the reportable-output contract (block catalog, neutral fragment model). Depends on nothing else in the workspace
hydra-engine-wdsWater-distribution engine: data model, parsers, unit conversion, GGA hydraulic solver, Lagrangian quality engine, session API, analytics, report blocks
hydra-engine-udsUrban-drainage engine — a published scaffold, deliberately empty until its development begins
hydra-engine-ochOpen-channel engine — likewise a published scaffold
hydra-enginesEngine dispatch: given a model of unknown provenance, decides which engine owns it. The one layer that sees both the registry and every engine, so the routing policy lives here once instead of in each interface
hydra-reportReport generation: templates, document assembly from engine-neutral fragments, and the txt/csv/html/PDF renderers. Knows nothing about any engine — it depends only on hydra-common
hydra-sdkUmbrella facade: re-exports the complete user-facing API with all dependency versions pre-pinned
hydra-cliCommand-line interface: resolves input, writes output files, generates reports; no simulation logic
hydra-guiDesktop application: Tauri shell with deck.gl canvas, timeline playback, network editor

The two empty engine scaffolds exist so their crate names and versions track the workspace from the start, rather than being introduced mid-life — see Engines for what each engine covers. The split between hydra-common, the engines, and hydra-report is what lets a report be assembled from any engine’s output: engines emit neutral fragments, and the report layer renders them without knowing which engine produced them.

hydra-cli and hydra-gui are downstream consumers of Hydra in exactly the same way a third-party integrator would be: they depend on the umbrella crate and never import from hydra-engine-wds directly. Anyone who wants a different interface (HTTP, gRPC, Python bindings, etc.) follows the same pattern.