proto_enum
macro:
-
First arg — name of the protobuf file with enum;
-
Second arg —
enum
defenition
Protobuf enum defenition:
//types.proto
enum AccountType {
AccountTypeNull = 0;
SYSTEM = 1;
GENERAL = 2;
MERCHANT = 3;
}
Rust representation of enum:
proto_enum! {
types;
enum AccountType {
AccountTypeNull = 0,
SYSTEM = 1,
GENERAL = 2,
MERCHANT = 3,
}
}
Thanks for posting this!