impl{type_generics_impl} {local}serde::Deserialize<'de> for {type_name}{type_generics_type}{type_generics_where} {{ fn deserialize(deserializer: D) -> Result where D: {local}serde::Deserializer<'de> {{ #[allow(non_camel_case_types)] enum Field {{ {fields} }} impl<'de> {local}serde::Deserialize<'de> for Field {{ fn deserialize(deserializer: D) -> Result where D: {local}serde::Deserializer<'de> {{ struct Visitor; impl<'de> {local}serde::de::Visitor<'de> for Visitor {{ type Value = Field; fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {{ f.write_str("field identifier") }} fn visit_str(self, v: &str) -> Result where E: {local}serde::de::Error {{ Ok(match v {{ {str_to_field_match_arms} }}) }} }} deserializer.deserialize_identifier(Visitor) }} }} struct Visitor{type_generics_type}{visitor_field}; impl{type_generics_impl} {local}serde::de::Visitor<'de> for Visitor{type_generics_type}{type_generics_where} {{ type Value = {type_name}{type_generics_type}; fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {{ f.write_str({visitor_expecting_type_name}) }} fn visit_map(self, mut map: A) -> Result where A: {local}serde::de::MapAccess<'de> {{ {field_value_defs} while let Some(key) = {local}serde::de::MapAccess::next_key::(&mut map)? {{ match key {{ {field_value_match_arms} }} }} Ok({type_name} {{ {field_value_assignment} }}) }} }} deserializer.deserialize_struct( {deserialize_type_name}, &[ {field_name_list} ], Visitor{visitor_create_field}, ) }} }}