[Rust] add enum for fury macro derive
as title
Hi, could you please clarify if you intend to add an enum to the macro, or if you're suggesting that the macro should be modified to support enums? Additional details would be helpful as the request is a bit ambiguous. Thanks!
https://github.com/apache/fury/blob/e99b46f4b83f79a23cf240466479da9e3657810d/rust/fury-derive/src/object/serializer.rs#L25-L29
It seems this is where we need to fix, please assign this issue to me. @theweipeng
This spec says enum are serialized as unsigned var int, but in Rust enum could carry payload, such as:
enum Location {
Unknown,
Anonymous,
Known(Coord),
}
enum ComplexEnum {
Nothing,
Something(u32),
LotsOfThings {
usual_struct_stuff: bool,
blah: String,
}
}
Those are actually tagged unions, so in first version I will only support enum without any payload, and we may need to discuss how to serialize those union.
@theweipeng @chaokunyang
https://serde.rs/enum-representations.html
Serde has 4 methods to serialize enum.