#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

#472 in Encoding

Download history 16/week @ 2024-09-14 29/week @ 2024-09-21 1/week @ 2024-09-28

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