Crates.io | kalgan_config |
lib.rs | kalgan_config |
version | 0.9.1 |
source | src |
created_at | 2022-02-20 16:50:56.579894 |
updated_at | 2022-02-24 14:30:37.067657 |
description | Collection of functions to retrieve data and settings parameters defined in yaml files used by Kalgan Framework. |
homepage | https://kalgan.eduardocasas.com |
repository | https://github.com/eduardocasas/kalgan-config |
max_upload_size | |
id | 535832 |
size | 13,384 |
Collection of functions to retrieve data and settings parameters defined in yaml files used by Kalgan Framework.
This is the yaml file to be used in the following tests:
## tests/settings.yaml
user:
name: John
is_real: false
age: 39
height: 1.78
children:
- Huey
- Dewey
- Louie
use kalgan_config::Config;
let config: Config = Config::new("tests/settings.yaml");
assert_eq!(config.get("user.name").unwrap(), "John");
assert_eq!(config.get_string("user.name").unwrap(), "John".to_string());
assert_eq!(config.get_bool("user.is_real").unwrap(), false);
assert_eq!(config.get_number("user.age").unwrap(), 39);
assert_eq!(config.get_float("user.height").unwrap(), 1.78);
assert_eq!(config.get_vec("user.children").unwrap(), vec!["Huey", "Dewey", "Louie"]);
For further information please visit:
This crate is licensed under either of the following licenses: