Open kaedwen opened 3 years ago
I want to write a custom serializer for a wrapped chrono::NaiveDate, but I want to serialize with the rename given in the derive.
chrono::NaiveDate
rename
impl YaSerialize for NaiveDate { fn serialize<W: Write>(&self, writer: &mut yaserde::ser::Serializer<W>) -> Result<(), String> { let _ret = writer.write(xml::writer::XmlEvent::characters(self.to_string().as_str())); Ok(()) } fn serialize_attributes( &self, attributes: Vec<xml::attribute::OwnedAttribute>, namespace: xml::namespace::Namespace, ) -> Result< ( Vec<xml::attribute::OwnedAttribute>, xml::namespace::Namespace, ), String, > { Ok((attributes, namespace)) } }
Is there any chance to write the default start_element given in a derive?
derive
I want to write a custom serializer for a wrapped
chrono::NaiveDate
, but I want to serialize with therename
given in the derive.Is there any chance to write the default start_element given in a
derive
?