GeneratedEnum
nscn.polaris2.protoc.runtime.GeneratedEnum
trait GeneratedEnum
Base trait of every generated proto enum.
Generated as a Scala 3 enum whose cases carry their proto number, plus an Unrecognized case:
enum Color(val value: Int) extends GeneratedEnum derives CanEqual:
case COLOR_UNKNOWN extends Color(0)
case COLOR_RED extends Color(1)
case Unrecognized(unrecognizedValue: Int) extends Color(unrecognizedValue)
Unrecognized is present even on a closed enum, so the API does not change shape with the enum's openness. Parsing a closed enum never produces it - an out-of-range value there belongs in the unknown fields, which is what editions mandates - so it can only come from an explicit GeneratedEnumCompanion.fromValue call.
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
Members list
In this article