You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.
is there any reason why enums are not supported?
I know there is no Enum type in Msgpack spec, but it seems to me there is a realy simple workaround.
Enum type can be decomposed into its variant index (uint) and rest of data whatever they are.
I have already tested it and it seems to work.
PR?
The text was updated successfully, but these errors were encountered:
Why ban so extremely useful feature?
We are able to encode/decode enums into valid Msgpack structure and I'm sure with little effort this would be also possible in other languages.
C++ has union type or more robust boost::variant and QVariant. Duck typed languages will neither have problems. In Java there could be simple switch statement on index returning reference to Object.
Msgpack has two big advantages over other serialization formats in current rust: It's schemaless (you have to just derive Encodable/Decodable) and effectient. For this reasons i'm sure it will become very popular in rust. And if enums will not be supported (althought it's so easy) there will be many forks in local projects. It would be better to support this directly here and just add some docs describing how enum support is implemented and it's not recommended to use them in cross-language projects unless they are necessary.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi,
is there any reason why enums are not supported?
I know there is no Enum type in Msgpack spec, but it seems to me there is a realy simple workaround.
Enum type can be decomposed into its variant index (uint) and rest of data whatever they are.
I have already tested it and it seems to work.
PR?
The text was updated successfully, but these errors were encountered: