Bug: 193649110

Clone this repo:
  1. 0ebb873 Migrate 8 crates to monorepo by James Farrell · 3 months ago main master
  2. f00d0e5 Regenerate Android.bp by James Farrell · 4 months ago
  3. 098521f Update Android.bp by running cargo_embargo am: 6eeb87530f am: dd4ea8cf86 by James Farrell · 8 months ago android15-automotiveos-dev android15-qpr1-release android15-qpr1-s3-release android15-qpr1-s4-release android15-qpr1-s5-release android15-tests-dev android-15.0.0_r10 android-15.0.0_r11 android-15.0.0_r12 android-15.0.0_r13 android-15.0.0_r6 android-15.0.0_r7 android-15.0.0_r8 android-15.0.0_r9
  4. dd4ea8c Update Android.bp by running cargo_embargo am: 6eeb87530f by James Farrell · 8 months ago
  5. 6eeb875 Update Android.bp by running cargo_embargo by James Farrell · 8 months ago

serde-xml-rs

Build Status

xml-rs based deserializer for Serde (compatible with 1.0)

Example usage

use serde::{Deserialize, Serialize};
use serde_xml_rs::{from_str, to_string};

#[derive(Debug, Serialize, Deserialize, PartialEq)]
struct Item {
    name: String,
    source: String,
}

fn main() {
    let src = r#"<Item><name>Banana</name><source>Store</source></Item>"#;
    let should_be = Item {
        name: "Banana".to_string(),
        source: "Store".to_string(),
    };

    let item: Item = from_str(src).unwrap();
    assert_eq!(item, should_be);

    let reserialized_item = to_string(&item).unwrap();
    assert_eq!(src, reserialized_item);
}