Trait bevy_app::IntoSystemAppConfig
source · pub trait IntoSystemAppConfig<Marker>: Sized {
// Required method
fn into_app_config(self) -> SystemAppConfig;
// Provided methods
fn in_schedule(self, schedule: impl ScheduleLabel) -> SystemAppConfig { ... }
fn on_startup(self) -> SystemAppConfig { ... }
}
Expand description
Types that can be converted into a SystemAppConfig
.
This has been implemented for all System<In = (), Out = ()>
trait objects
and all functions that convert into such.
Required Methods§
sourcefn into_app_config(self) -> SystemAppConfig
fn into_app_config(self) -> SystemAppConfig
Converts into a SystemAppConfig
.
Provided Methods§
sourcefn in_schedule(self, schedule: impl ScheduleLabel) -> SystemAppConfig
fn in_schedule(self, schedule: impl ScheduleLabel) -> SystemAppConfig
sourcefn on_startup(self) -> SystemAppConfig
fn on_startup(self) -> SystemAppConfig
Adds the system to CoreSchedule::Startup
.
This is a shorthand for self.in_schedule(CoreSchedule::Startup)
.
Systems in this schedule will run exactly once, at the start of the App
’s lifecycle.
Examples
fn my_startup_system(_commands: Commands) {
println!("My startup system");
}
App::new()
.add_system(my_startup_system.on_startup())
.run();
Panics
If the system has already been assigned to a schedule.