yaml_file_handler

Crates.ioyaml_file_handler
lib.rsyaml_file_handler
version0.1.4
sourcesrc
created_at2015-10-21 19:48:10.986814
updated_at2015-12-16 00:01:56.610782
descriptionA Yaml File Handler based on yaml-rust
homepagehttps://github.com/JeanDenisVIDOT/yaml_file_handler
repository
max_upload_size
id3279
size3,285
Jean-Denis VIDOT (jh3ady)

documentation

README

Yaml File handler

A Yaml File Handler written in Rust. Based on Yaml implementation of [Chyh1990] (https://github.com/chyh1990/yaml-rust)

## How to use it

Cargo.toml

yaml_file_handler = "0.1.3"

Simple example:

extern crate yaml_rust;

pub mod yaml_handler;
use yaml_handler::FileHandler;

#[test]
fn it_works() {
    let mut handler = FileHandler::new();

    handler.add_files(vec![
        "parameters.yml",
        "routing.yml"
    ]);

    let config = match handler.read_all_files() {
        Some(data) => data,
        None => return,
    };

    println!("config['parameters']['server']['hostname'] = {}", config["parameters"]["server"]["hostname"].as_str().unwrap());
}
Commit count: 0

cargo fmt