#[derive(SerializeAttribute)]
{
// Attributes available to this derive:
#[xattribute]
}
Expand description
Derives the SerializeAttribute trait for a type.
This macro works to serialize to XML-attributes.
To serialize to elements, use the Serialize derive macro instead.
NOTE: It is perfectly possible to derive both Serialize and SerializeAttribute for the same type, allowing the parent to decide which serialization method to use. Since deserialization can work from multiple sources, simply deriving Deserialize is sufficient to deserialize from either elements or attributes (depending on what is enabled through the derive macro).
To configure the serialization, use the #[xattribute(...)] attribute on the root of the type. This attribute is required.
§Configuration
§Serialize as an attribute - #[xattribute(...)] on the root of a type
§Options
| |||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|