You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be useful to allow access to UserData across different dynamic library modules for structs that are guaranteed to have the same size and alignment. The bytemuck crate exports a few traits that can be implemented using declarative macros in a safe interface that could be used for that purpose.
If dependence on bytemuck is undesirable, perhaps AnyUserData could export access to the raw byte slice, done after a few runtime checks (see here an implementation), in which case the user would be responsible for the explicit cast:
I don't know how viable this is, however, since mlua would need to keep some information at runtime about the size and alignment of any registered types, and I don't know if this is the case.
The text was updated successfully, but these errors were encountered:
It would be useful to allow access to
UserData
across different dynamic library modules for structs that are guaranteed to have the same size and alignment. Thebytemuck
crate exports a few traits that can be implemented using declarative macros in a safe interface that could be used for that purpose.mlua
could export something like:If dependence on
bytemuck
is undesirable, perhapsAnyUserData
could export access to the raw byte slice, done after a few runtime checks (see here an implementation), in which case the user would be responsible for the explicit cast:I don't know how viable this is, however, since
mlua
would need to keep some information at runtime about the size and alignment of any registered types, and I don't know if this is the case.The text was updated successfully, but these errors were encountered: