Simple compile-time reflection for nullary enum variants

Sometimes, there's the need to have a way to inspect and change some values at runtime (for example via a combobox with egui, like in games or other similar software) and for enums it is possible to do it either manually or by using some derive from third-party crates.

The issue is that it isn't possible to do it with enums defined in third-party crates. The only workaround is to create another enum that provides this mapping manually.

I have seen some previous discussion regarding compile-time reflection but I don't know if there is any progress on that front.

It would be nice to have a (experimental, without any stability guarantee at the moment?) official way to access the (at least only the nullary) variants of any enum to be able to obtain a string and a lambda to create the variant, like for example a const method (or a macro) that returns [(&'static str, Fn() -> T)].

I don't think this will ever exist without opt-in from the defining type.

Compile-time reflection absolutely makes sense as a feature, but it'll probably always be something that you opt-in to by deriveing something on said enum, to implement a trait that provides the functionality.