Replies: 2 comments 1 reply
-
You can store type id in a metatable during userdata construction, to fetch it back later. |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
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?
Beta Was this translation helpful? Give feedback.
All reactions