2 ms·
FYI: https://docs.rs/enum_dispatch https://docs.rs/enum_dispatch This doesn't work for every case of dynamic dispatch (it only works for what I call closed and
by sunshowers 2y ago
FYI: https://docs.rs/enum_dispatch https://docs.rs/enum_dispatch
This doesn't work for every case of dynamic dispatch (it only works for what I call closed and semi-open universes of choices [1]), but it works for many of them. And there can always be a catch-all variant that uses a trait object.
[1] https://sunshowers.io/posts/open-closed-universes/ https://sunshowers.io/posts/open-closed-universes/
- lowbloodsugar 2y agoThanks. I was hoping/dreading that someone had already written such a thing. Hoping, because I have this problem. Dreading, because so much “practical” Rust is macros to make up for missing expressiveness of the language itself.