Skip to main content

parse

Function parse 

Source
pub fn parse(content: &str) -> Result<Config>
Expand description

Parse TOML content from a string.

§Errors

Returns an error if the TOML is invalid.

§Example

use derive_defs::parser;

let toml = r#"
[defs.model]
traits = ["Debug", "Clone"]
"#;

let config = parser::parse(toml).unwrap();
assert!(config.defs.contains_key("model"));