我需要将PB存储在PB消息定义之外定义的PB消息中。有可能吗?怎么样?
答案 0 :(得分:3)
这是可能的。查看this thread了解更多信息。 我喜欢在单独的.proto文件中定义枚举的建议。像
enums.proto
enum A
{
FIRST = 1;
SECOND = 2;
}
enum B { ... }
other.proto
import "enums.proto";
message SOMEMESSAGE
{
required A myenum = 1;
}