Replies: 2 comments 1 reply
|
You can store type id in a metatable during userdata construction, to fetch it back later. |
0 replies
This is what I was doing: the problem is if you're creating lua methods that take your type as an argument, then it either has to implement FromLuaMulti, or you have to do a bit of boilerplate to convert it back from AnyUserData on every method. And you can't implement FromLuaMulti so it stores the TypeId, because it returns Self. |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I've been messing around with constructing things at runtime, and the problem is, sometimes you don't know what type it is on the rust side. So AnyUserdata::is::() doesn't help you.
Could we add something like:
to the AnyUserdata impl?
All reactions