Crate props_rs

source ·
Expand description

props-rs is a library which parses a .properties file format as specified by the Oracle documentation

use props_rs::*;

let properties = br"
key1=value1
key2=value2
key3=value3
";
let parsed = parse(properties).unwrap();
let properties = to_map(parsed);

assert_eq!("value1", properties.get("key1").unwrap());
assert_eq!("value2", properties.get("key2").unwrap());
assert_eq!("value3", properties.get("key3").unwrap());

Structs

A property representing a parsed configuration key-value pair.

Functions

Parses a properties file and returns a Vec of properties. There may potentially be properties with duplicate keys in the returned Vec.
A convenience function which converts a Vec of Property into a set of Property stored in a HashMap