rust-lua53 icon indicating copy to clipboard operation
rust-lua53 copied to clipboard

WIP: Serde support

Open tailhook opened this issue 7 years ago • 2 comments

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.

tailhook avatar Jun 06 '17 10:06 tailhook

Okay, now it supports enough to serialize any Json. Other things are not obvious how to serialize properly (like tuple structs and similar).

tailhook avatar Jun 06 '17 16:06 tailhook

serde_json treats tuple structs just like sequences. I think it would be reasonable to do the same.

SpaceManiac avatar Jun 06 '17 23:06 SpaceManiac