/// Auto-generated type for unnamed Avro union variants. #[derive(Debug, PartialEq, Clone, serde::Deserialize, serde::Serialize)] #[serde(remote = "Self")] pub enum UnionStringLongDoubleBoolean { String(String), Long(i64), Double(f64), Boolean(bool), } impl From for UnionStringLongDoubleBoolean { fn from(v: String) -> Self { Self::String(v) } } impl TryFrom for String { type Error = UnionStringLongDoubleBoolean; fn try_from(v: UnionStringLongDoubleBoolean) -> Result { if let UnionStringLongDoubleBoolean::String(v) = v { Ok(v) } else { Err(v) } } } impl From for UnionStringLongDoubleBoolean { fn from(v: i64) -> Self { Self::Long(v) } } impl TryFrom for i64 { type Error = UnionStringLongDoubleBoolean; fn try_from(v: UnionStringLongDoubleBoolean) -> Result { if let UnionStringLongDoubleBoolean::Long(v) = v { Ok(v) } else { Err(v) } } } impl From for UnionStringLongDoubleBoolean { fn from(v: f64) -> Self { Self::Double(v) } } impl TryFrom for f64 { type Error = UnionStringLongDoubleBoolean; fn try_from(v: UnionStringLongDoubleBoolean) -> Result { if let UnionStringLongDoubleBoolean::Double(v) = v { Ok(v) } else { Err(v) } } } impl From for UnionStringLongDoubleBoolean { fn from(v: bool) -> Self { Self::Boolean(v) } } impl TryFrom for bool { type Error = UnionStringLongDoubleBoolean; fn try_from(v: UnionStringLongDoubleBoolean) -> Result { if let UnionStringLongDoubleBoolean::Boolean(v) = v { Ok(v) } else { Err(v) } } } impl serde::Serialize for UnionStringLongDoubleBoolean { 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 UnionStringLongDoubleBoolean { fn deserialize(deserializer: D) -> Result where D: serde::Deserializer<'de>, { Self::deserialize(deserializer) } } #[derive(Debug, PartialEq, Clone, serde::Deserialize, serde::Serialize)] pub struct Contact { pub extra: Option, }