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§

Provided Methods§

source

fn in_schedule(self, schedule: impl ScheduleLabel) -> SystemAppConfig

Adds the system to the provided schedule.

If a schedule is not specified, it will be added to the App’s default schedule.

Panics

If the system has already been assigned to a schedule.

source

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.

Implementors§

source§

impl IntoSystemAppConfig<()> for SystemAppConfig

source§

impl<Marker, T> IntoSystemAppConfig<Marker> for Twhere T: IntoSystemConfig<Marker>,