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 |
#866 in Configuration
27 downloads per month
Used in 4 crates
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
- Apache License, Version 2.0, (./LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (./LICENSE-MIT or http://opensource.org/licenses/MIT)
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
~255–550KB
~11K SLoC