1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//!
//!
//! # Examples
//!
//! ```rust
//! extern crate serde;
//! extern crate serde_xml_rs;
//!
//! #[macro_use]
//! extern crate serde_derive;
//!
//! 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);
//! }
//! ```

#[macro_use]
extern crate log;
#[macro_use]
extern crate serde;
extern crate xml;

extern crate thiserror;

#[cfg(test)]
#[macro_use]
extern crate serde_derive;

#[macro_use]
mod error;
pub mod de;
pub mod ser;

pub use de::{from_reader, from_str, Deserializer};
pub use error::Error;
pub use ser::{to_string, to_writer, Serializer};
pub use xml::reader::{EventReader, ParserConfig};