Expand description
High performance XML reader/writer.
§Description
quick-xml contains two modes of operation:
A streaming API based on the StAX model. This is suited for larger XML documents which cannot completely read into memory at once.
The user has to explicitly ask for the next XML event, similar to a database cursor. This is achieved by the following two structs:
Reader
: A low level XML pull-reader where buffer allocation/clearing is left to user.Writer
: A XML writer. Can be nested with readers if you want to transform XMLs.
Especially for nested XML elements, the user must keep track where (how deep) in the XML document the current event is located.
quick-xml contains optional support of asynchronous reading and writing using tokio.
To get it enable the async-tokio
feature.
Furthermore, quick-xml also contains optional Serde support to directly
serialize and deserialize from structs, without having to deal with the XML events.
To get it enable the serialize
feature. Read more about mapping Rust types
to XML in the documentation of de
module. Also check serde_helpers
module.
§Examples
§Features
quick-xml
supports the following features:
Re-exports§
pub use crate::encoding::Decoder;
pub use crate::reader::NsReader;
pub use crate::reader::Reader;
pub use crate::writer::ElementWriter;
pub use crate::writer::Writer;
Modules§
- Serde
Deserializer
module. - A module for wrappers that encode / decode data.
- Manage xml character escapes
- Defines zero-copy XML events used throughout this library.
- Module for handling names according to the W3C Namespaces in XML 1.1 (Second Edition) specification
- Contains high-level interface for a pull-based XML parser.
- Module to handle custom serde
Serializer
- Provides helper functions to glue an XML with a serde content model.
- Contains high-level interface for an events-based XML emitter.
Macros§
- A helper to implement
Deserialize
for internally tagged enums which does not useDeserializer::deserialize_any
that produces wrong results with XML because of serde#1183.
Enums§
- (De)serialization error
- The error type used by this crate.
Type Aliases§
- A specialized
Result
type where the error is hard-wired toError
.