mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-01 03:01:37 +00:00
Rework enums in rust. (#6098)
* Rework enums in rust. They're now a unit struct, rather than an enum. This is a backwards incompatible change but the previous version had UB and was also backwards incompatible so... * Update and test sample rust flatbuffers * Use bitflags crate to properly support rust enums. Previously, the bitflags attribute was just ignored. This is a breaking change as the bitflgs API is not like a normal rust enum (duh). * variant_name() -> Option<_> * repr transparent * Reexport bitflags from flatbuffers * Make bitflags constants CamelCase, matching normal enums * Deprecate c-style associated enum constants Co-authored-by: Casper Neo <cneo@google.com>
This commit is contained in:
@@ -12,3 +12,4 @@ categories = ["encoding", "data-structures", "memory-management"]
|
||||
|
||||
[dependencies]
|
||||
smallvec = "1.0"
|
||||
bitflags = "1.2"
|
||||
|
||||
Reference in New Issue
Block a user