async-xml 0.2.2

A crate for deserializing XML data asynchronously.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use async_xml::{from_str, XmlVec};
use async_xml_derive::FromXml;

#[tokio::main]
async fn main() {
    let report: Report = from_str(r#"<report><ids>2 4 6 7</ids></report>"#)
        .await
        .unwrap();
    println!("deserialized: {:?}", report);
}

#[derive(Debug, PartialEq, FromXml)]
#[async_xml(rename = "report")]
pub struct Report {
    #[async_xml(child, rename = "ids")]
    pub data: XmlVec<u32>,
}