-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Implement System::system_metas(&self) and System::system_metas_mut(&mut self) for system exploration and configuration
#16275
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
base: main
Are you sure you want to change the base?
Conversation
|
Welcome, new contributor! Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨ |
|
@alice-i-cecile |
|
@MiniaczQ, opinions? |
|
In all of the cases other than for piped systems, this method should return a vector with one element :) |
|
Yeah, I didn't want to tackle this, because it's actually pretty technical. Step 1We definitely need a trait that has Now, to make this actually work, we need another set of methods (in that trait): Step 2Then there is the matter of in-lining it. let mut my_system = IntoSystem::into_system(my_system);
my_system.system_metas_mut()[0].name = "abba".into();
app.add_systems(Update, my_system);so we want a app.add_systems(Update, my_system.map_system_metas(|metas| { metas[0].name = "abba".into(); }));no need for immutable variant. Step 3Sadly this isn't the end for this issue, we also should expose |
|
Thanks for the detailed overview :) |
a43457b to
407f957
Compare
|
@MiniaczQ
|
|
Looks good! |
c1b7131 to
aac8a2e
Compare
|
Done with non-primitive systems, if this looks fine we can work with the next steps. |
aac8a2e to
acaf4e2
Compare
|
@alice-i-cecile @MiniaczQ CI looks good. |
…(&mut self)` for system exploration and configuration Part of bevyengine#16168
acaf4e2 to
205c023
Compare
|
Welcome back! I'm worried the use case for this change may have disappeared in the meantime, though. The linked issue says this is "needed for system param warning, which currently can be configured only for function systems", but system param validation has been reworked since then, with Following that and #19477, all Do we really still need this API? |
|
At a first glance, looks like this may not be required, but do we have the same way of direct access this API provides? It's more like a user's choice which allows one to get a deeper access. I can't think of a use case that this especially provides at the moment, but I feel if we introduce this and let users sort of play with it in the next release we can get a better idea. If not, we could always remove it? |
|
@chescock |
Whoops, sorry, missed this message for a while!
I think my argument here is that we do! Looking at the fields on But I'm also just a random reviewer and not a SME or maintainer :). If you can get some more consensus that this is a good direction then I'm happy to give it a proper review! I just don't want to waste your time nitpicking the implementation if we aren't going to do this anyway. |
|
Cool, thanks for the feedback, maybe in the future if there's a critical discussion in this area we can come back to it. Looking into other issues :) |
Part of #16168
Objective
Implement
System::system_metas(&self)andSystem::system_metas_mut(&mut self)for system exploration and configuration.Solution
Introduce System::system_metas(&self) and System::system_metas_mut(&mut self) which would return iterator/vector/slice that we can work with.