LSD
This is a Rust implementation of LSD (Less Syntax Data) configuration/data transfer format.
This is first implementation ever. If there ever will be any other implementations in this repository, they will most likely be a copy of this implementation.
Installation
Cargo/Crates
Main way of adding LSD to your Rust projects is via official crates.io repository.
Command
Cargo.toml
Precise version (example; in case this README is not updated copy from crates.io page):
= "0.1.0"
Latest (for quick personal projects, not production):
= "*"
From GitHub
You may also let cargo build development LSD directly off of the GitHub branch.
Command
Cargo.toml
= { = "https://github.com/kirillsemyonkin/lsd.git" }
From local folder
If you have a local variant you are working on, you may also refer to it instead.
Command
Cargo.toml
= { = "path/to/lsd/rust" }
Usage
Once you got LSD into your Rust project, import (use) it in your code:
use LSD; // Just LSD enum itself
use LSD::*; // LSD variants (LSD::Level, LSD::List, LSD::Value)
use key; // `key!` macro
use *; // Import everything directly into your scope (except those variants)
There is one parse method available for you:
let file_lsd = LSDparse?;
let string_lsd = LSDparse?;
To access values, it is useful to have key! macro ready:
let lang_key = "rust";
let lang_name = lsd
.value?
.ok_or_else?;
Check out documentation to see more of the API.
Planned
- Saving to a file
-
serdesupport