# Macro toml::toml

source · [−]

    macro_rules! toml {
        ($($toml:tt)+) => { ... };
    }

Expand description

Construct a `toml::Value` from TOML syntax.

    let cargo_toml = toml::toml! {
        [package]
        name = "toml"
        version = "0.4.5"
        authors = ["Alex Crichton <alex@alexcrichton.com>"]

        [badges]
        travis-ci = { repository = "alexcrichton/toml-rs" }

        [dependencies]
        serde = "1.0"

        [dev-dependencies]
        serde_derive = "1.0"
        serde_json = "1.0"
    };

    println!("{:#?}", cargo_toml);