Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serde support for ToLua #82

Open
tailhook opened this issue Jun 2, 2017 · 1 comment
Open

Serde support for ToLua #82

tailhook opened this issue Jun 2, 2017 · 1 comment

Comments

@tailhook
Copy link
Contributor

tailhook commented Jun 2, 2017

Hi, I want to implement support for ToLua for T:Serialze from serde. So you can lua_push just about anything :)

The problem I encountered is:

error[E0119]: conflicting implementations of trait `wrapper::convert::ToLua` for type `std::option::Option<unsafe extern "C" fn(*mut libc::c_void) -> i32>`:

Can we remove that implementation and make a newtype for it? The alternative is to make a wrapper for serde:

lua.push(SerdeWrapper(object))

Which, might be good too, but I still think it's superfluous. What do you think?

@tailhook
Copy link
Contributor Author

tailhook commented Jun 2, 2017

Another question is that serialization can fail. Should ToLua panic when it fails? Or maybe we could change ToLua::to_lua to allow errors?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant