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 Foo {
Bar bar = 1;
}
enum Bar {
a = 0;
b = 1;
}
Is there a way to obtain all the valid enum values/keys?
I know that I can switch between atom and integer with Bar.value(:a) and Bar.key(0), but I couldn't find a way to obtain something like Bar.keys() to obtain [:a, :b], Bar.values() to obtain [0, 1] or Bar.map() to obtain %{a: 0, b: 1}
My apologies if there's already a function implemented and I didn't find it. If there isn't, I think it could be helpful.
The text was updated successfully, but these errors were encountered:
Assuming I have the following .proto file
Is there a way to obtain all the valid enum values/keys?
I know that I can switch between atom and integer with
Bar.value(:a)
andBar.key(0)
, but I couldn't find a way to obtain something likeBar.keys()
to obtain[:a, :b]
,Bar.values()
to obtain[0, 1]
orBar.map()
to obtain%{a: 0, b: 1}
My apologies if there's already a function implemented and I didn't find it. If there isn't, I think it could be helpful.
The text was updated successfully, but these errors were encountered: