Replies: 1 comment 2 replies
-
mlua by-design support only userdata that were made using mlua (high level) api, to ensure data types safety. Probably the easiest way would be making
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm porting a large C codebase, and need to provide a C API for
lua_tofoo
,luaL_checkfoo
,luaL_pushfoo
, andlua_isfoo
for a userdata typefoo
that is in Rust. I've just implemented by working C code using theffi
interface ofmlua
, but it's not matching theUserData
. My main question is what is going to be the UserData's name registered in the metatable, and if the following code is the best way to handle this?I'm registering the module with:
It seems like the mlua userdata is dealing with this differently from the C API so it fails to detect the userdata as the correct type.
Beta Was this translation helpful? Give feedback.
All reactions