mlua-rs/rlua

Question: How to share state/struct between Lua context and Rust?

Closed this issue · 0 comments

Hello,

I have some trouble trying to "share" a struct which can be used both by Lua and Rust. Reason for this is that I want to expose just a part of an API to the user in Lua and the rest gets handled by Rust. I tried to make my point by providing the example here.

Either I ran into the trap that I can't borrow Foo again or when using ownership I don't assure static lifetime.

Now is there some way to implement and did I missed something? Or is my idea not possible?

Thank you in advance!!!