Hacker News new | ask | show | jobs
by i_don_t_know 85 days ago
I’m not sure I fully understand but this seems to be the kind of problem that Ocaml functors solve. You program against an interface (signature) and you supply a concrete implementation (structure) when you want to run it. You can use different implementations in different parts of your application.

So maybe do something similar in Rust by expanding how you import and export modules?