Crate slr_config [] [src]

This crate implements the parsing for the SLRConfig format. Basic usage revolves around the creation and use of the ConfigElement type, like so:

extern crate slr_config;

use slr_config::{ConfigElement};
use std::path::Path;

fn main()
{
    // Parse config element from value.
    let (root, _) = ConfigElement::from_str(Path::new("<dummy>"), "key = value").unwrap();
    assert_eq!(root.as_table().unwrap()["key"].as_value().unwrap(), "value");

    // Create a new table and print it to a string.
    let mut root = ConfigElement::new_table();
    let val = ConfigElement::new_value("value");
    root.insert("key", val);
    assert_eq!(root.to_string(), "key = value\n");
}

Structs

ConfigElement
ConfigString
Printer

Enums

ConfigElementKind
StringKind

Traits

GetError
Visitor

Functions

parse_source