#[repr(i32)]pub enum Edition {
Unknown = 0,
Proto2 = 998,
Proto3 = 999,
Edition2023 = 1_000,
Edition2024 = 1_001,
Edition1TestOnly = 1,
Edition2TestOnly = 2,
Edition99997TestOnly = 99_997,
Edition99998TestOnly = 99_998,
Edition99999TestOnly = 99_999,
Max = 2_147_483_647,
}
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.
Edition2024 = 1_001
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
Max = 2_147_483_647
Placeholder for specifying unbounded edition support. This should only ever be used by plugins that can expect to never require any changes to support a new edition.
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.
Trait Implementations§
§impl<'de> Deserialize<'de> for Edition
impl<'de> Deserialize<'de> for Edition
§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
source§impl Ord for Edition
impl Ord for Edition
source§impl PartialEq for Edition
impl PartialEq for Edition
source§impl PartialOrd for Edition
impl PartialOrd for Edition
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl TryFrom<i32> for Edition
impl TryFrom<i32> for Edition
§type Error = DecodeError
type Error = DecodeError
impl Copy for Edition
impl Eq for Edition
impl StructuralPartialEq for Edition
Auto Trait Implementations§
impl Freeze for Edition
impl RefUnwindSafe for Edition
impl Send for Edition
impl Sync for Edition
impl Unpin for Edition
impl UnwindSafe for Edition
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request