pub enum EnumRepr {
Name(String),
Number(i32),
}Expand description
How a protobuf enum arrived on the wire: by name, or by number.
Variants§
Name(String)
The canonical form — the proto value name, e.g. "STATE_DONE".
Number(i32)
The numeric form, which the JSON mapping also permits.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for EnumRepr
impl<'de> Deserialize<'de> for EnumRepr
Source§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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for EnumRepr
impl RefUnwindSafe for EnumRepr
impl Send for EnumRepr
impl Sync for EnumRepr
impl Unpin for EnumRepr
impl UnsafeUnpin for EnumRepr
impl UnwindSafe for EnumRepr
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