I’ve faced a challenge of serializing and deserializing of Box. The full description can be found here. It looks like the problem of deserializing Box cannot be solved without having reflection information (correct me if I’m wrong) : it’s needed to match TypeID to the deserialization method for the type in runtime.
So I started thinking about how reflection could have been implemented in Rust. I realise that there are some limitations for languages that are compiled to native code but a lot of things can be made available. It seems that during compilation compiler can generate descriptive structures for all the types, traits, enums and functions. Ideally there could be also possibility of invoking functions and to have access to struct members. There should be no overhead in performance. The memory overhead will be equal to the summarised size of the descriptive structures, one instance per type, trait, enum or function. Of course, there should be possibility of turning generation of reflection information on and off because for embedded development even this memory overhead can be significant.
I’m very sorry for writing such obvious thoughts. But I couldn’t find any up-to-date information about reflection status or plans. Does anyone know if some reflection implementations were discussed or maybe even some prototypes been made?