Crates.io | corosync-config-parser |
lib.rs | corosync-config-parser |
version | 0.1.0 |
source | src |
created_at | 2022-06-14 13:16:11.26342 |
updated_at | 2022-06-14 13:16:11.26342 |
description | A Rust crate for hassle-free Corosync's configuration file parsing |
homepage | |
repository | |
max_upload_size | |
id | 605818 |
size | 27,976 |
A Rust crate for hassle-free Corosync's configuration file parsing.
Inspired by Kilobyte22/config-parser.
extern crate corosync_config_parser;
let corosync_example = "
logging {
fileline: off
to_stderr: no
to_logfile: no
logfile: /var/log/cluster/corosync.log
to_syslog: yes
debug: off
timestamp: on
logger_subsys {
subsys: QUORUM
debug: off
}
}
"
.to_string();
let cfg = corosync_config_parser::parse(corosync_example).unwrap();
let subsys = cfg
.matching("logging")
.nth(0)
.unwrap()
.matching("logger_subsys")
.nth(0)
.unwrap()
.matching("subsys")
.nth(0)
.unwrap()
.get(0);