pub enum ProtoVersion {
Proto2,
Proto3,
Edition2023,
Edition2024,
}Expand description
The protobuf version a file is read as.
The canonical runtime spells this as the string union
'proto2' | 'proto3' | '2023' | '2024', and ProtoVersion::as_str
gives the same four strings.
Variants§
Implementations§
Source§impl ProtoVersion
impl ProtoVersion
Sourcepub fn from_declared(value: &str) -> Option<ProtoVersion>
pub fn from_declared(value: &str) -> Option<ProtoVersion>
The version a declaration value names, or None for anything
outside the four this package supports.
Trait Implementations§
Source§impl Clone for ProtoVersion
impl Clone for ProtoVersion
impl Copy for ProtoVersion
Source§impl Debug for ProtoVersion
impl Debug for ProtoVersion
Source§impl<'de> Deserialize<'de> for ProtoVersion
impl<'de> Deserialize<'de> for ProtoVersion
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ProtoVersion
impl Display for ProtoVersion
impl Eq for ProtoVersion
Source§impl Hash for ProtoVersion
impl Hash for ProtoVersion
Source§impl PartialEq for ProtoVersion
impl PartialEq for ProtoVersion
Source§impl Serialize for ProtoVersion
impl Serialize for ProtoVersion
impl StructuralPartialEq for ProtoVersion
Auto Trait Implementations§
impl Forget for ProtoVersion
impl Freeze for ProtoVersion
impl RefUnwindSafe for ProtoVersion
impl Send for ProtoVersion
impl Sync for ProtoVersion
impl Unpin for ProtoVersion
impl UnsafeUnpin for ProtoVersion
impl UnwindSafe for ProtoVersion
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
Compare self to
key and return true if they are equal.