So rust finally gets reflection? In stable no less!
@bwrsandman @snaggen More a RTTI than reflection…
@bwrsandman That’s why I used ”More a” than ”Is a”… 😉
Well, if the only thing you need from reflection is the name of a type, so then yes. But I wouldn’t really call this reflection since it is very limited.
Yeah, Rust can’t have proper reflection, since there’s no external runtime environment that keeps track of your state. Any such smartness either has to be compiled-in (which is how std::any
and macros work) or you can implement something to keep track of this state at runtime, as if you were partially building a runtime environment.
Minor point of clarification: it can’t have runtime reflection, but in principle it could have compile time reflection.