corosync-config-parser 0.1.0

A Rust crate for hassle-free Corosync's configuration file parsing
Documentation
  • Coverage
  • 18.18%
    8 out of 44 items documented0 out of 23 items with examples
  • Size
  • Source code size: 27.67 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 4.68 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • dottorblaster

corosync-config-parser

A Rust crate for hassle-free Corosync's configuration file parsing.

Inspired by Kilobyte22/config-parser.

Usage

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);