> For example rust does not encode "this is a database call" in its type system.
Right, and some languages - like Lean - can do that.