I took a stab at a reply to your question on Stack overflow:
https://stackoverflow.com/questions/78355748/nested-enum-with-protobuf
On Friday, April 19, 2024 at 5:10:25 PM UTC-7 Chedy Souffargi wrote:
> I am working on a Rust project, using Protocol Buffers, and dealing with
> nested enums. Here's what I have so far in Rust:
>
> enum Vehicle { Car(CarType), Truck(TruckType), } enum CarType { Sedan,
> Coupe, Hatchback, } enum TruckType { Pickup, Semi, } fn
> create_vehicle_fleet() -> [Vehicle; 8] { [ Vehicle::Car(CarType::Sedan),
> Vehicle::Truck(TruckType::Pickup), Vehicle::Car(CarType::Coupe), Vehicle::
> Truck(TruckType::Semi), Vehicle::Car(CarType::Hatchback),
> Vehicle::Car(CarType::Sedan),
> Vehicle::Truck(TruckType::Pickup), Vehicle::Car(CarType::Coupe), ] }
>
> I cannot find a proper way to represent the Vehicle enum in protobuf. Can
> anyone suggest a solution or provide guidance on how to handle this
> situation in Protocol Buffers?
>
--
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/protobuf/9827eaf2-7b6f-474c-9cfa-f3fbca084ab8n%40googlegroups.com.