compiler-explorer / compiler-explorer/compiler-explorer
[REQUEST]: Supporting `enum_dispatch` in Rust
- Dominant language
- TypeScript
- Stars
- 19.1k
- Forks
- 2.1k
- Avg merge
- 3d 15h
- Merged PRs (30d)
- 67
Description
### Is your feature request related to a problem? Please describe
I'd like to be able to use [`enum_dispatch`](https://docs.rs/enum_dispatch/latest/enum_dispatch/) with Rust. The motivation is to compare it (sample [here](https://godbolt.org/z/GzjaxWvEs)) with C++ compile-time dispatch using `std::variant` and `std::visit` (sample [here](https://godbolt.org/z/44b7jcE9r))
### Describe the solution you'd like
Being able to use
```rust
extern crate enum_dispatch;
use enum_dispatch::enum_dispatch;
```
### Describe alternatives you've considered
None, as `enum_dispatch` isn't present in the [available Rust crates](https://conan.compiler-explorer.com/libraries_rust.html)
### Additional context
Not applicable
Contributor guide
Assessment
This issue has not been assessed yet.