What problem does this solve or what need does it fill?
Directly ran systems (i.e. one-shot systems) currently effectively require a 'static bound on the System::In associated type, preventing one from passing (non-'static) references as input to a system via System::run:
|
fn run(&mut self, input: Self::In, world: &mut World) -> Self::Out { |
Being able to pass non-'static references to one-shot systems would likely allow us to create full systems as egui widgets, an extension of #5522's rudimentary WidgetSystem into full-featured (exclusive) Systems, for example.
Given that System::In is only ever used as a function argument, it should be possible to implement this in a way that doesn't lose trait objects? I did some experimental implementing of this recently by turning it into a GAT, but ran into the trait object issue and haven't attempted since.
What solution would you like?
For systems that are ran directly (one-shot systems), allow passing non-'static references as system input.
What alternative(s) have you considered?
Clone objects that need to be passed in. This doesn't work for all cases, though.
What problem does this solve or what need does it fill?
Directly ran systems (i.e. one-shot systems) currently effectively require a
'staticbound on theSystem::Inassociated type, preventing one from passing (non-'static) references as input to a system viaSystem::run:bevy/crates/bevy_ecs/src/system/system.rs
Line 63 in 365cf31
Being able to pass non-
'staticreferences to one-shot systems would likely allow us to create full systems aseguiwidgets, an extension of #5522's rudimentaryWidgetSysteminto full-featured (exclusive)Systems, for example.Given that
System::Inis only ever used as a function argument, it should be possible to implement this in a way that doesn't lose trait objects? I did some experimental implementing of this recently by turning it into a GAT, but ran into the trait object issue and haven't attempted since.What solution would you like?
For systems that are ran directly (one-shot systems), allow passing non-
'staticreferences as system input.What alternative(s) have you considered?
Clone objects that need to be passed in. This doesn't work for all cases, though.