rust-lua53
rust-lua53 copied to clipboard
WIP: Serde support
This is just a skeleton code for #82
Currently, it's mostly unimplemented I'm sharing it with you so you can take a glance and give some recommendations before I've written tons of boilerplate code.
The major issue is error handling. Currently, we panic on error because can't propagate it through ToLua
trait.
It uses quick_error
for reducing boilerplate for errors, I can remove it if you wish. Also, now I see that I should reformat code to 2-space indent, but that's an easy part.
Okay, now it supports enough to serialize any Json. Other things are not obvious how to serialize properly (like tuple structs and similar).
serde_json
treats tuple structs just like sequences. I think it would be reasonable to do the same.