Expand description
Derive xml-data
trait implementations
Deriving supports the following attributes on the struct:
#[xml_data(tag("..."))]
: XML tag (only for derivingElement
); defaults to struct name#[xml_data(crate(...))]
: Name ofxml-data
crate in local scope; defaults toxml_data
#[xml_data(ignore_unknown)]
: Ignore unhandled/unknown attributes, inner nodes and inner text (only for derivingElement
;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ยง
- Derive
xml-data::{parser,serializer}::Element
- Derive
xml-data::{parser,serializer}::Inner
- Derive
xml-data::parser::Element
- Derive
xml-data::parser::Inner
- Derive
xml-data::serializer::Element
- Derive
xml-data::serializer::Inner