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
18
use async_xml::from_str;
use async_xml_derive::FromXml;

#[tokio::main]
async fn main() {
    let xml = r#"<data><empty /></data>"#;
    let de: DataTuple = from_str(xml).await.unwrap();
    println!("deserialized: {:?}", de);
}

#[derive(Debug, PartialEq, FromXml)]
pub struct DataTuple {
    #[async_xml(child)]
    empty: Option<EmptyTuple>,
}

#[derive(Debug, PartialEq, FromXml)]
pub struct EmptyTuple();