Skip to content

Get a scoped subreference #45

@Shatur

Description

@Shatur

I'm working on a crate that adds scripting for Bevy that I plan to use in my game.

Bevy provides a structure called App, which can provide access to World via App::world/world_mut. The App is owned by Rust side and I can temporary pass a reference to it using the scope API. But inside Lua I sometimes need access to the World. Is it possible to somehow return a mutable reference to the world from a method that will be invalidated together with the App? I.e. I basically need to return a "subreference". I know that it will be valid as long as the App itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions