lpsettings

Crates.iolpsettings
lib.rslpsettings
version0.2.3
sourcesrc
created_at2018-12-18 20:49:35.9226
updated_at2018-12-28 18:43:11.643738
descriptiona settings library for accessing lovepack settings
homepage
repositoryhttps://github.com/snsvrno/lpsettings-rs
max_upload_size
id102583
size23,204
Snsvrno (snsvrno)

documentation

README

lpsettings

A cli tool and library for managing lovepack settings.

lpsettings is primarily designed to act as a rust library for lovepack to make it easier to write and read settings from various lovepack project sources. It can be compiled into a standalone binary for stand-alone settings interaction.

Using the Library

Add the library to your Cargo.toml lpsettings = "0.2" and then start getting settings.

// get a setting
lpsettings::get_value("user.name");

// set a setting
lpsettings::set_value("user.email","user@email.com");

lpsettings use a enum to contain all the possible types in a settings file, you will need to match these to get the underlying values

use lpsettings::Type // repeated from settingsfile

if let Some(Type::Text(username)) == lpsettings::get_value("user.name") {
    println!("Your username is set to {}", username);
}

Compiling the Binary

Clone this project and run cargo inside the src-binary

cd src-binary
cargo build --release

The binary follows the version of the library, so build to the latest tagged repository to get the correct release version.

Commit count: 34

cargo fmt