I've heard that technique described as "type tetris". I find myself trusting the type system to guide me a lot in Rust too -- it's very nice!
Like Haskell Servant[1], where you define your API as a type, and then you can derive functions from that type to query the API, because the type itself contains all the information necessary.
Pretty fascinating stuff.
[1] http://haskell-servant.readthedocs.io/en/stable/tutorial/Api...