- Notifications
You must be signed in to change notification settings - Fork0
fruit-bird/intomap
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
An implementation of a serialization-like trait. Inspired byChapter 9 of "The Complete Rust Programming Reference Guide"
Check out myblog post explaining this. It cover more concepts than the aforementioned book, like derive attributes
#[derive(IntoMap)]structUser{name:&'staticstr,#[intomap(ignore)]id:usize,#[intomap(rename ="online")]active:bool,}let user =User{name:"Jimothy",id:0,active:true,};let user_map = user.as_map();println!("{:#?}", user_map);
BTreeMap { "name": "Jimothy", "online": "true",}
Started with trying to learn how derive macros work. Ended with me starting a blog