It is recommended to prefix enum variant with the enum name in ptotobuf for better support in some languages as such:
enum RuleLevel {
RULE_LEVEL_UNKNOWN = 0;
RULE_LEVEL_INFORMATIONAL = 1;
RULE_LEVEL_LOW = 3;
RULE_LEVEL_MEDIUM = 4;
RULE_LEVEL_HIGH = 5;
RULE_LEVEL_CRITICAL = 6;
}
But in Rust it would be more idomatic to remove the prefix and CamelCase the variant as such:
enum RuleLevel {
Unknown,
Informational,
Low,
Medium,
High,
Critical,
}
This is what prost does for example.
It is recommended to prefix enum variant with the enum name in ptotobuf for better support in some languages as such:
But in Rust it would be more idomatic to remove the prefix and CamelCase the variant as such:
This is what
prostdoes for example.