Rust-ConfigParser
⚙ Very simple config parsing lib for rust!
💠 Install
Just add the following to your Cargo.toml
:
[]
= "0.1.3"
📀 Quick Start
This config parser is made for use with a simplified version of an ini file. There are no sections and currently no Escape character support.
; This is a comment
# This is also a comment
hello = World
rust = Is great
test = "TEST"
💥Examples
Import Module.
// Import Lib
use Config;
Create a new config.
// Create a new config with no file
let mut cfg = new;
// Create a new config with a file
let mut cfg2 = new;
Read a config file and parse it.
// Create a new config with a file
let mut cfg2 = new;
// Read / parse config file
cfg.read.ok.expect;
Load config from a string.
// Create a new config with no file
let mut cfg = new;
// Parse config from string
cfg.parse.ok.expect;
Get a value from a config.
// Create a new config with no file
let mut cfg = new;
// Create a new config with a file
let mut cfg2 = new;
// Get a value from the config (As a string)
println!;