Expand description
The quick_xml
module contains helper types for serializing and deserializing
generated code using the quick_xml
crate.
Re-exports§
pub use crate::models::RawByteStr;
pub use self::reader::ErrorReader;
pub use self::reader::IoReader;
pub use self::reader::SliceReader;
pub use self::reader::XmlReader;
pub use self::reader::XmlReaderSync;
Modules§
- reader
- Defines and implements different helper traits that are needed for the
deserialization process with the
quick_xml
crate.
Structs§
- BytesC
Data - CDATA content contains unescaped data from the reader. If you want to write them as a text,
convert it to
BytesText
. - Bytes
Decl - An XML declaration (
Event::Decl
). - Bytes
End - Closing tag data (
Event::End
):</name>
. - BytesPI
- Processing instructions (PIs) allow documents to contain instructions for applications.
- Bytes
Start - Opening tag data (
Event::Start
), with optional attributes:<name attr="value">
. - Bytes
Text - Data from various events (most notably,
Event::Text
) that stored in XML in escaped form. Internally data is stored in escaped form. - Content
Deserializer - Implements a
Deserializer
for any type that implementsDeserializeBytes
. - Deserialize
StrError - Error that is raised by the
DeserializeBytes
trait if the type implementsFromStr
, but the conversion from the string has failed. - Deserializer
Output - Type that is used to bundle the output of a
Deserializer
operation. - Error
- Quick XML Error
- Local
Name - A local (unqualified) name of an element or an attribute, i.e. a name without prefix.
- Namespace
- A namespace name that is declared in a
xmlns[:prefix]="namespace name"
. - QName
- A qualified name of an element or an attribute, including an optional namespace prefix and a local name.
- Union
Error - Contains the different errors that occurred when deserializing a union.
- Writer
- XML writer. Writes XML
Event
s to astd::io::Write
implementor.
Enums§
- Content
Serializer - Implements a
Serializer
for any type that implementsSerializeBytes
. - Deserializer
Artifact - Artifact that is returned by a
Deserializer
. - Deserializer
Event - Indicates what to do with a event returned by a deserializer
- Element
Handler Output - Controls the flow of the deserializer
- Error
Kind - Quick XML error kind.
- Event
- Event emitted by
Reader::read_event_into
. - Iter
Serializer - Implements a
Serializer
for any type that implements anIterator
that emits references to a type that implementsWithSerializer
. - Resolve
Result - Result of prefix resolution which creates by
NamespaceResolver::resolve
,NsReader::resolve_attribute
,NsReader::resolve_element
,NsReader::read_resolved_event
andNsReader::read_resolved_event_into
methods. - Validate
Error - Error raised by different XML value validation functions.
Traits§
- Deserialize
Bytes - Trait that could be implemented by types to support deserialization from
XML byte streams using the
quick_xml
crate. - Deserialize
Bytes From Str - Marker trait used to automatically implement
DeserializeBytes
for any type that implementsFromStr
. - Deserialize
Reader - Reader trait with additional helper methods for deserializing.
- Deserialize
Sync - Trait that could be implemented by types to support deserialization from XML
using the
quick_xml
crate. - Deserializer
- Trait that defines a deserializer that can be used to construct a type from a
XML
Event
s. - Serialize
Bytes - Trait that could be implemented by types to support serialization to XML byte streams.
- Serialize
Bytes ToString - Marker trait used to automatically implement
SerializeBytes
for any type that implementsToString
. - Serialize
Sync - Trait that could be implemented by types to support serialization to XML
using the
quick_xml
crate. - Serializer
- Trait that defines a serializer that can be used to destruct a type to
suitable XML
Event
s. - With
Boxed Serializer - Trait that returns a boxed version of a
Serializer
for any type that implementsWithSerializer
. - With
Deserializer - Trait that defines the
Deserializer
for a type. - With
Serializer - Trait that defines the
Serializer
for a type. - XmlWrite
- A trait for objects which are byte-oriented sinks.
Functions§
- filter_
xmlns_ attributes - Returns an iterator that yields all attributes of the passed
bytes_start
object, except thexmlns
attributes. - fraction_
digits - Helper method the get the number of fraction digits for a decimal string value.
- total_
digits - Helper method the get the total number of digits for a decimal string value.
- whitespace_
collapse - Helper method to collapse whitespaces in a string value.
- whitespace_
replace - Helper method to replace whitespaces in a string value.
- write_
attrib - Write the passed
attrib
to the passedbytes
object. - write_
attrib_ opt - Write the passed
attrib
to the passedbytes
object.
Type Aliases§
- Boxed
Serializer - Boxed version of a
Serializer
. - Deserializer
Result - Result type returned by the
Deserializer
trait.