Skip to content
New issue

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

Impl HandlerParam for &World, &mut World #60

Open
andrewgazelka opened this issue May 9, 2024 · 1 comment
Open

Impl HandlerParam for &World, &mut World #60

andrewgazelka opened this issue May 9, 2024 · 1 comment

Comments

@andrewgazelka
Copy link
Contributor

Pros

Cons

  • I am not sure how much this would be used. Right now, I have everything that would need a &World or &mut World running outside of a system.
@rj00a
Copy link
Owner

rj00a commented May 9, 2024

&World might be doable, but &mut World within a handler would lead to unsoundness. It would be possible to send an event for the currently running handler, causing mutable aliasing. You could also do things like remove handlers which would invalidate the iterator over the current HandlerList.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants