Crate tomson

Source
Expand description

tomson provides conversions from Toml to Json and Json to Toml

§Example

let toml = r#"
[foo]
bar = 1
"#;

let json = r#"
{"foo":{"bar":1}}
"#;

match tomson::Toml::as_json(&mut toml.to_string()) {
    Ok(json) => println!("json -> {:?}", json),
    Err(e)   => println!("invalid toml -> {:?}", e)
};

match tomson::Json::as_toml(&mut json.to_string()) {
  Ok(toml) => println!("toml -> {:?}", toml),
  Err(e)   => println!("invalid json -> {:?}", e)
};

Structs§

Json
Provides converstions from Json to Toml
Toml
Provides convertions from Toml to Json

Traits§

JsonSrc
Represents an Json input source
TomlSrc
Represents an Toml input source