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, the reportable-output contract (block catalog, neutral fragment model), and the element-taxonomy, quantity, result-variable and criteria contracts. 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: SWMM data model and import, rainfall-runoff hydrology, dynamic-wave routing, water quality, controls, session API, predecessor-format output
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
hydra-demoThe engines compiled to WebAssembly, and the browser demo built on them. Not published to crates.io: the artifact is the built bundle

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, hydra-gui and hydra-demo 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. hydra-demo doubles as proof that the pattern reaches into a browser, where there is no filesystem and no thread to lean on.