Closed cisaacson closed 2 months ago
This issue is stale because it has been open 6 months with no activity. Please comment or label not-stale
, or this will be closed in 14 days.
This issue was automatically closed due to no activity for 6 months plus the 14 day notice period.
In the older version of rust-flatbuffers the code gen for enum types were standard Rust enums, like:
Now in the latest version it builds a struct with accessors. Is the functionality the same? Can we access the new struct type just like an
enum
? We usestrum
to work withenum
types to make it easy to do things like get a string value for the variant (and others). We also have a lot of cases likeMyEnum::B as u16
In addition, we now see this warning in the generated code:
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
I read about the issue, looks like it is not resolve yet. Is there anything we should do to accommodate this? Or just wait until it is resolved in the future?
We did try out the new version and it is functionally compatible with what we have been doing (without the need for
strum
). However I wonder why it was done this way? In other languages like Python and TypeScript it just generates idiomatic nativeenum
s, and in Rust you could have usedimpl
on theenum
to add other functionality?