[][src]Function serde_xml_rs::ser::to_string

pub fn to_string<S: Serialize>(value: &S) -> Result<String, Error>

A convenience method for serializing some object to a string.

Examples

#[derive(Serialize)]
struct Person {
  name: String,
  age: u32,
}


let joe = Person {name: "Joe".to_string(), age: 42};
let serialized = to_string(&joe).unwrap();
println!("{}", serialized);