Module value

Source
Expand description

This module contains the XmlValue type, which is a type which can be serialized or deserialized as XML, and a type which other types can deserialize from/serialize into.

It also contains subtypes to XmlValue including XmlText, XmlElement, and XmlAttribute, which can be used to deserialize from/serialize into specific types of XML data.

This is very useful in cases where you have arbitrary XML data, and you want to deserialize it into a type which can be used in your application, but you don’t know what the type is ahead of time and want to be able to handle it generically.

The types in this module can be constructed using the crate::xml! macro.

Structs§

XmlAttribute
An XML attribute.
XmlCData
CDATA section.
XmlComment
XML Comment
XmlDecl
Represents an XML declaration.
XmlDoctype
A doctype declaration.
XmlElement
An XML element.
XmlProcessingInstruction
A processing instruction.
XmlSeq
A sequence of XML elements.
XmlText
A text node in an XML document.

Enums§

XmlChild
An XML child node.
XmlValue
A value that can be serialized or deserialized as XML, and a type which other types can deserialize from/serialize into.
XmlValueDeserializerError
Error type for deserializing XML values.
XmlValueSerializerError
Error type for serializing XML values.

Functions§

from_value
Creates any T implementing [Deserialize] from an XmlValue
to_value
Creates an XmlValue from any T implementing [Serialize].