/// Auto-generated type for unnamed Avro union variants. #[derive(Debug, PartialEq, Eq, Clone, serde::Deserialize, serde::Serialize)] #[serde(remote = "Self")] pub enum UnionLong { Long(i64), } impl From for UnionLong { fn from(v: i64) -> Self { Self::Long(v) } } impl From for i64 { fn from(v: UnionLong) -> Self { let UnionLong::Long(v) = v; v } } impl serde::Serialize for UnionLong { fn serialize(&self, serializer: S) -> Result where S: serde::Serializer, { struct NewtypeVariantSerializer(S); impl serde::Serializer for NewtypeVariantSerializer where S: serde::Serializer, { type Ok = S::Ok; type Error = S::Error; type SerializeSeq = serde::ser::Impossible; type SerializeTuple = serde::ser::Impossible; type SerializeTupleStruct = serde::ser::Impossible; type SerializeTupleVariant = serde::ser::Impossible; type SerializeMap = serde::ser::Impossible; type SerializeStruct = serde::ser::Impossible; type SerializeStructVariant = serde::ser::Impossible; fn serialize_bool(self, _v: bool) -> Result { unimplemented!() } fn serialize_i8(self, _v: i8) -> Result { unimplemented!() } fn serialize_i16(self, _v: i16) -> Result { unimplemented!() } fn serialize_i32(self, _v: i32) -> Result { unimplemented!() } fn serialize_i64(self, _v: i64) -> Result { unimplemented!() } fn serialize_u8(self, _v: u8) -> Result { unimplemented!() } fn serialize_u16(self, _v: u16) -> Result { unimplemented!() } fn serialize_u32(self, _v: u32) -> Result { unimplemented!() } fn serialize_u64(self, _v: u64) -> Result { unimplemented!() } fn serialize_f32(self, _v: f32) -> Result { unimplemented!() } fn serialize_f64(self, _v: f64) -> Result { unimplemented!() } fn serialize_char(self, _v: char) -> Result { unimplemented!() } fn serialize_str(self, _v: &str) -> Result { unimplemented!() } fn serialize_bytes(self, _v: &[u8]) -> Result { unimplemented!() } fn serialize_none(self) -> Result { unimplemented!() } fn serialize_some(self, _value: &T) -> Result{ unimplemented!() } fn serialize_unit(self) -> Result { unimplemented!() } fn serialize_unit_struct(self, _name: &'static str) -> Result { unimplemented!() } fn serialize_unit_variant(self ,_name: &'static str, _variant_index: u32, _variant: &'static str) -> Result { unimplemented!() } fn serialize_newtype_struct(self, _name: &'static str, _value: &T,) -> Result { unimplemented!() } fn serialize_seq(self,_len: Option,) -> Result { unimplemented!() } fn serialize_tuple(self, _len: usize) -> Result { unimplemented!() } fn serialize_tuple_struct(self,_name: &'static str,_len: usize) -> Result { unimplemented!() } fn serialize_tuple_variant(self,_name: &'static str,_variant_index: u32,_variant: &'static str,_len: usize) -> Result { unimplemented!() } fn serialize_map(self,_len: Option) -> Result { unimplemented!() } fn serialize_struct(self,_name: &'static str,_len: usize) -> Result { unimplemented!() } fn serialize_struct_variant(self,_name: &'static str,_variant_index: u32,_variant: &'static str,_len: usize) -> Result { unimplemented!() } fn serialize_newtype_variant( self, _name: &'static str, _variant_index: u32, _variant: &'static str, value: &T, ) -> Result { value.serialize(self.0) } } Self::serialize(self, NewtypeVariantSerializer(serializer)) } } impl<'de> serde::Deserialize<'de> for UnionLong { fn deserialize(deserializer: D) -> Result where D: serde::Deserializer<'de>, { Self::deserialize(deserializer) } } #[derive(Debug, PartialEq, Eq, Clone, serde::Deserialize, serde::Serialize)] pub struct Mono { #[serde(rename = "myField")] pub my_field: UnionLong, }