Open mitsuhiko opened 2 years ago
Another issue with the descriptors right now is that you can only return borrow the hole thing. Which means that when implementing newtypes the implementation of the descriptor can only pick between returning a new one (with for instance a custom name) or the internal one and forward it completely transparently.
So for instance a NewType(u32)
needs to pick between reporting NewType
as name or the internal name with 4
as precision.
Right now the type descriptors are not very useful for anything that is a compound type. For instance the type descriptor for
Option<T>
cannot properly express what's going on. The same applies toVec<T>
which cannot really talk about what theT
is.More importantly the design does not provide for more interesting answers that one needs to have about types such as if a value might need to be skipped on serialization or deserialization (#3).