Simple Crate For Converting Hashmaps To Structs
Convert HashMap<String, String> values directly into structs,
with optional type conversion per field.
Provides one main trait and derive macro,
named Map2Struct.
Example
use HashMap;
use Map2Struct;
let mut map = new;
map.insert;
map.insert;
let person = from_map.expect;
assert_eq!;
assert_eq!;
Fields are parsed using the .parse method of String
values.
The following validations steps are performed:
- Check if all fields are present
- Check that no additional fields are present
- Check type conversions