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
and implement the UserData for those.
If I now, however, write an accessor for one of the axis for Lua, I have to wrap the resulting Value in my crate-local files. This leads (because of the ownership) to a copied Object in Lua and if I edit that, the original axis (obviously) doesn't get changed...
The only 2 options I see to circumvent this is to, either reimplement these types in my crate (not something I'm very keen on) or modify the original (glam) crate to have all the external types implement UserData.
Is there something I'm missing, i.e. a way to circumvent the orphan rules that gives me the ability to retain ownership of the object with Mat3? Or implementing UserData for the references? Or have a reference wrapper (how would that work?)?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, I'm currently having the following problem: I have external dependent types, something like:
from an external crate.
I now want to bind Mat3 into the Lua context. To do this I (have to) use the rust "newtype" pattern, so:
and implement the
UserData
for those.If I now, however, write an accessor for one of the axis for Lua, I have to wrap the resulting Value in my crate-local files. This leads (because of the ownership) to a copied Object in Lua and if I edit that, the original axis (obviously) doesn't get changed...
The only 2 options I see to circumvent this is to, either reimplement these types in my crate (not something I'm very keen on) or modify the original (glam) crate to have all the external types implement
UserData
.Is there something I'm missing, i.e. a way to circumvent the orphan rules that gives me the ability to retain ownership of the object with
Mat3
? Or implementingUserData
for the references? Or have a reference wrapper (how would that work?)?Your help would be much appreciated.
Beta Was this translation helpful? Give feedback.
All reactions