#[repr(i32)]pub enum Edition {
Unknown = 0,
Proto2 = 998,
Proto3 = 999,
Edition2023 = 1_000,
Edition1TestOnly = 1,
Edition2TestOnly = 2,
Edition99997TestOnly = 99_997,
Edition99998TestOnly = 99_998,
Edition99999TestOnly = 99_999,
}Expand description
The full set of known editions.
Variants§
Unknown = 0
A placeholder for an unknown edition value.
Proto2 = 998
Legacy syntax “editions”. These pre-date editions, but behave much like distinct editions. These can’t be used to specify the edition of proto files, but feature definitions must supply proto2/proto3 defaults for backwards compatibility.
Proto3 = 999
Edition2023 = 1_000
Editions that have been released. The specific values are arbitrary and should not be depended on, but they will always be time-ordered for easy comparison.
Edition1TestOnly = 1
Placeholder editions for testing feature resolution. These should not be used or relyed on outside of tests.
Edition2TestOnly = 2
Edition99997TestOnly = 99_997
Edition99998TestOnly = 99_998
Edition99999TestOnly = 99_999
Implementations§
Source§impl Edition
impl Edition
Sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
Sourcepub fn from_str_name(value: &str) -> Option<Self>
pub fn from_str_name(value: &str) -> Option<Self>
Creates an enum from field names used in the ProtoBuf definition.