[][src]Crate xml_data_derive

Derive xml-data trait implementations

Deriving supports the following attributes on the struct:

  • #[xml_data(tag("..."))]: XML tag (only for deriving Element); defaults to struct name
  • #[xml_data(crate(...))]: Name of xml-data crate in local scope; defaults to xml_data
  • #[xml_data(ignore_unknown)]: Ignore unhandled/unknown attributes, inner nodes and inner text (only for deriving Element; Inner never fails for unknown data)

And the following attributes on struct fields:

  • #[xml(attr)]: Mark field as attribute for containing XML element (only for deriving Element`)
  • #[xml(attr("..."))]: Mark field as attribute for containing XML element with given key (only for deriving Element`)
  • #[xml(attr_string)]: Mark field as string attribute (using ValueStringinstead of ValueDefault) for containing XML element (only for deriving Element`)

Multiple attributes can be combined like #[xml(tag("..."), ignore_unknown)].

Derive Macros

Element

Derive xml-data::{parser,serializer}::Element

Inner

Derive xml-data::{parser,serializer}::Inner

ParserElement

Derive xml-data::parser::Element

ParserInner

Derive xml-data::parser::Inner

SerializerElement

Derive xml-data::serializer::Element

SerializerInner

Derive xml-data::serializer::Inner