#parser #deserialize #libconfig

bin+lib libconfig-rs

libconfig parser in rust

7 stable releases

3.0.0 Apr 15, 2024
2.0.1 Mar 10, 2023
2.0.0 Sep 9, 2022
1.0.5 Sep 9, 2022
1.0.4 Sep 8, 2022

#611 in Encoding

46 downloads per month

0BSD license

46KB
1.5K SLoC

libconfig parser with serde support


    #[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);

Dependencies

~2–2.9MB
~55K SLoC