We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have a struct with a few members I am also exposing in my Lua API.
At the moment I wrap the struct member in an Rc, though this is technically incorrect since wgpu safety requires my window to outlive surfaces.
struct Example { foo: Foo, bar: Bar, // must outlive foo }
I think something like this would be quite nice:
struct Example { scope: mlua::Scope, foo: Foo, bar: Bar, // must outlive foo and scope } lua.register_userdata_type::<EventLoopWindowTarget<()>>(|reg| { reg.add_field_method_get("foo", |_, this| { this.scope.create_any_userdata_ref(&this.foo) }); })?;
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have a struct with a few members I am also exposing in my Lua API.
At the moment I wrap the struct member in an Rc, though this is technically incorrect since wgpu safety requires my window to outlive surfaces.
I think something like this would be quite nice:
The text was updated successfully, but these errors were encountered: