This is a little library/crate that makes writing a river layout generator in Rust as simple as implementing a single trait. See an example here.