pub fn to_toml_string<T>(value: &T) -> Result<String>
Expand description
Converts the value to a TOML string.
ยงExamples
extern crate serde;
#[macro_use]
extern crate serde_derive;
extern crate serdeconv;
// Defines a serializable struct.
#[derive(Serialize)]
struct Foo {
bar: &'static str,
baz: usize
}
// Converts the `Foo` value to a TOML string.
let foo = Foo { bar: "aaa", baz: 123 };
let toml = serdeconv::to_toml_string(&foo).unwrap();
assert_eq!(toml, "\
bar = \"aaa\"
baz = 123
");