libconfig-rs

Crates.iolibconfig-rs
lib.rslibconfig-rs
version3.0.0
sourcesrc
created_at2022-09-08 09:51:30.002277
updated_at2024-04-15 15:50:29.542374
descriptionlibconfig parser in rust
homepage
repositoryhttps://github.com/JoNil/libconfig-rs
max_upload_size
id660981
size73,518
Jonathan Nilsson (JoNil)

documentation

https://docs.rs/libconfig-rs

README

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);
Commit count: 44

cargo fmt