# [WIP] esyn
[<img alt="github" src="https://img.shields.io/badge/github-rsuu/esyn-8da0cb?style=for-the-badge&labelColor=555555&logo=github" height="20">](https://github.com/rsuu/esyn)
[<img alt="crates.io" src="https://img.shields.io/crates/v/esyn.svg?style=for-the-badge&color=fc8d62&logo=rust" height="20">](https://crates.io/crates/esyn)
[<img alt="docs.rs" src="https://img.shields.io/badge/docs.rs-esyn-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs" height="20">](https://docs.rs/esyn)
[<img alt="build status" src="https://img.shields.io/github/actions/workflow/status/rsuu/esyn/ci.yml?branch=main&style=for-the-badge" height="20">](https://github.com/rsuu/esyn/actions?query=branch%3Amain)
> Rusty Config File Parser.
## Example
```rust
fn main() {
#[derive(Debug, PartialEq, EsynDe)]
enum Map {
Up,
Down,
}
#[derive(Debug, PartialEq, EsynDe)]
struct Window {
borderless: bool,
topmost: bool,
}
#[derive(Debug, PartialEq, EsynDe)]
struct Config {
name: String,
map: Map,
invert_mouse: bool,
font: Option<String>,
window: Window,
}
let esyn = esyn::Esyn::from_file("./full.rs").unwrap();
let list = esyn.get::<Config>("test_example").unwrap();
let a = &list[0];
assert_eq!(a.name, "bala".to_string());
assert_eq!(a.map, Map::Down);
assert_eq!(a.font, None);
assert_eq!(a.window.borderless, true);
assert_eq!(a.window.topmost, true);
dbg!(a);
}
```
## Supported Types
```rust
u8 u16 u32 u64 u128 usize
i8 i16 i32 i64 i128 isize
f32 f64
bool
char String
Option<T>
Vec<T>
Box<T>
Named Struct
Unit Enum
Unnamed Enum
Named Enum
// TODO:
// (T, .., T) // Tuple
//
// StructUnnamed
// StructEmpty
// EnumEmpty
```