Function forest_filecoin::utils::io::read_toml

source ·
pub fn read_toml<S>(toml_string: &str) -> Result<S>
where for<'de> S: Deserialize<'de>,
Expand description

Converts a TOML file represented as a string to S

§Example

use serde::Deserialize;
use forest_filecoin::doctest_private::read_toml;

#[derive(Deserialize)]
struct Config {
    name: String
};

let toml_string = "name = \"forest\"\n";
let config: Config = read_toml(toml_string).unwrap();
assert_eq!(config.name, "forest");