Crates.io | libconfig-rs |
lib.rs | libconfig-rs |
version | 3.0.0 |
source | src |
created_at | 2022-09-08 09:51:30.002277 |
updated_at | 2024-04-15 15:50:29.542374 |
description | libconfig parser in rust |
homepage | |
repository | https://github.com/JoNil/libconfig-rs |
max_upload_size | |
id | 660981 |
size | 73,518 |
#[derive(Serialize, Deserialize)]
struct TestInteger {
a: i32,
}
let test = TestInteger {
a: 42,
};
let ser = libconfig_rs::to_string(&test).unwrap();
let der = libconfig_rs::from_str(&ser).unwrap();
assert_eq!(test, der);
let config = "config : { test : [1, 2, 3]; }";
let res = libconfig_rs::Value::from_str(config).unwrap();
println!("{:#?}", res);