#yaml #parser

quire

A YAML-based configuration parsing library

15 releases

Uses old Rust 2015

0.4.1 Jul 23, 2018
0.3.1 Sep 21, 2017
0.2.3 Apr 21, 2017
0.2.2 Feb 22, 2017
0.1.0 Jun 22, 2015

#599 in Configuration

Download history 42/week @ 2023-11-05 41/week @ 2023-11-12 36/week @ 2023-11-19 76/week @ 2023-11-26 89/week @ 2023-12-03 40/week @ 2023-12-10 60/week @ 2023-12-17 57/week @ 2023-12-24 17/week @ 2023-12-31 54/week @ 2024-01-07 51/week @ 2024-01-14 42/week @ 2024-01-21 57/week @ 2024-01-28 41/week @ 2024-02-04 90/week @ 2024-02-11 311/week @ 2024-02-18

507 downloads per month
Used in 4 crates

MIT/Apache

230KB
6K SLoC

Rust Quire

Status: Beta

The rust-quire is a Rust port for quire configuration parsing library. It also contains YAML parser (however, it tuned for configuration parsing rather than generic YAML parser, e.g. it assumes YAML always fits memory).

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


lib.rs:

Yaml-based configuration parsing and validation library

Example

extern crate quire;
#[macor_use] extern crate serde_derive;
use quire::{parse_config, Options};
use quire::validate::{Structure, Scalar};

#[derive(Deserialize)]
struct Config {
    item1: String,
    item2: Option<String>,
}

fn validator<'static>() -> Structure<'static> {
    Structure::new()
    .member("item1", Scalar::new())
    .member("item2", Scalar::new().optional())
}

let cfg: Config;
cfg = parse_config("config.yaml", &validator(), &Options::default())
      .expect("valid config");

Dependencies

~265–560KB
~11K SLoC