#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

#328 in Encoding

Download history 14/week @ 2024-09-12 19/week @ 2024-09-19 13/week @ 2024-09-26

1,359 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

~1.9–2.8MB
~54K SLoC