3 ms·
How do you imagine that reflection would be useful for serialization in Rust?
by wyager 11y ago
How do you imagine that reflection would be useful for serialization in Rust?
- saboot 11y agoIn the way I asked here, http://stackoverflow.com/questions/29109967/why-dont-many-compiled-languages-include-compile-time-reflection http://stackoverflow.com/questions/29109967/why-dont-many-co... I am not very familiar with rust, is what I was describing currently possible?
- wyager 11y agoIt's not possible, but there's also no good reason to do it. You might as well just make an e.g. Serializable trait that requires you to manually implement the serialize function. You're not saving a whole lot of work by looping through the object's fields and saving them. Most objects only have a few fields to serialize anyway.