suido
suido (水道) is a dependency-free Rust library for reasoning about a small
water-supply plan. It keeps units explicit and applies two simple principles:
- water is conserved, so supply, demand, and storage must balance;
- the same flow moves faster through a smaller circular pipe.
The library reports whether instantaneous supply has a surplus, is balanced, or has a deficit. For a deficit, it also estimates how long stored water can cover the gap. Pipe velocity is calculated from volumetric flow and internal diameter.
Example
use ;
let mut plan = new;
plan.add_demand?;
plan.add_demand?;
let report = plan.evaluate?;
assert_eq!;
assert_eq!;
assert_eq!;
# Ok::
Run the bundled example:
cargo run --example household
Scope and safety
This crate provides transparent arithmetic, not a building-code compliance check or a substitute for a licensed plumbing engineer. Real systems also depend on pressure, elevation, friction loss, water quality, local rules, diversity assumptions, fire demand, pipe material, and equipment data.
License
MIT