This is not conformant with protobuf enums. It implements Closed enums, but unknown values are not stored at all. So, unknown values cannot be serialized back. It can be used in proto2, with this caveat. A int32 pint can be used instead of this, which is conformant with proto3.
Procs
func computeFieldSize(field: int; value: enum; ProtoType: type ProtobufExt; skipDefault: static bool): int {....raises: [], gcsafe.}
- Source Edit
func computeFieldSize(field`gensym5: int; value`gensym5: seq[enum]; ProtoType`gensym5: type ProtobufExt; skipDefault`gensym5: static bool): int {....raises: [], gcsafe.}
- Source Edit
func computeFieldSizePacked(field: int; value: openArray[enum]; ProtoType: type ProtobufExt): int {....raises: [], gcsafe.}
- Source Edit
proc readFieldInto(stream: InputStream; value: var (enum); header: FieldHeader; ProtoType: type ProtobufExt): bool {. ...raises: [SerializationError, IOError], raises: [], gcsafe.}
- Source Edit
proc readFieldInto(stream`gensym5: InputStream; value`gensym5: var seq[enum]; header`gensym5: FieldHeader; ProtoType`gensym5: type ProtobufExt): bool {. ...raises: [SerializationError, IOError], raises: [], gcsafe.}
- Source Edit
proc readFieldPackedInto(stream: InputStream; value: var seq[enum]; header: FieldHeader; ProtoType: type ProtobufExt): bool {. ...raises: [SerializationError, IOError], raises: [], gcsafe.}
- Source Edit
func supportsPacked(_: type enum; ProtoType`gensym5: type ProtobufExt): bool {. ...raises: [], gcsafe.}
- Source Edit
func supportsPacked(_: type seq[enum]; ProtoType`gensym5: type ProtobufExt): bool {. ...raises: [], gcsafe.}
- Source Edit
proc writeField(stream: OutputStream; field: int; value: enum; ProtoType: type ProtobufExt; skipDefault: static bool = false) {. ...raises: [IOError], raises: [], gcsafe.}
- Source Edit
proc writeField(stream`gensym5: OutputStream; field`gensym5: int; value`gensym5: seq[enum]; ProtoType`gensym5: type ProtobufExt; skipDefault`gensym5: static bool = false) {....raises: [IOError], raises: [], gcsafe.}
- Source Edit
proc writeFieldPacked(stream: OutputStream; field: int; value: openArray[enum]; ProtoType: type ProtobufExt) {....raises: [IOError], raises: [], gcsafe.}
- Source Edit