-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Possible to define a system as generic over SystemParam and provide concrete type? #3300
Comments
Your reasoning that it implicitly binds a concrete version, i.e. the I think one way to work around this would be would be for us to create a The alternative is to create a struct and implement I think that |
I'm looking into how to do this in It's possible that there is a doable lifetime change to the Also, I don't understand the way the lifetimes work out to reproduce without bevy. If anyone can make a reproduction, I'll ask the broader rust community for help. |
# Objective - Fixes bevyengine#3300 - `RunSystem` is messy ## Solution - Adds the trick theorised in bevyengine#3300 (comment) P.S. I also want this for an experimental refactoring of `Assets`, to remove the duplication of `Events<AssetEvent<T>>` Co-authored-by: Carter Anderson <mcanders1@gmail.com>
# Objective - Fixes bevyengine#3300 - `RunSystem` is messy ## Solution - Adds the trick theorised in bevyengine#3300 (comment) P.S. I also want this for an experimental refactoring of `Assets`, to remove the duplication of `Events<AssetEvent<T>>` Co-authored-by: Carter Anderson <mcanders1@gmail.com>
Here's a minimal example of what I'm trying to do:
AFAIU, the problem is that
generic_system::<NullImpl>
is implicitly bindingNullImpl<'_>
, so that it doesn't satisfyfor<'a>
. I would think it should work if I were able to write something like:generic_system::<for<'a> NullImpl<'a>>.system()
, but that doesn't parse.Is there something I can do to make this compile? I've tried to make a non-bevy example to ask the broader Rust community, but I haven't been able to reproduce.
The text was updated successfully, but these errors were encountered: