Skip to main content

IntoSystemConfig

Trait IntoSystemConfig 

Source
pub trait IntoSystemConfig<Params>: IntoSystem<Params> + Sized {
    // Required methods
    fn after<S2, P2>(self, other: S2) -> SystemConfig<Self, Params>
       where S2: IntoSystem<P2> + 'static;
    fn before<S2, P2>(self, other: S2) -> SystemConfig<Self, Params>
       where S2: IntoSystem<P2> + 'static;
    fn priority(self, priority: i32) -> SystemConfig<Self, Params>;
}
Expand description

Lets .after(...)/.before(...)/.priority(...) be called directly on a system — a plain function, closure, or anything else IntoSystem is implemented for — to declare where it must run relative to another system in the same Schedule, or how it should be prioritized against unconstrained systems:

schedule
    .add_system(spawn_enemies)
    .add_system(move_enemies.after(spawn_enemies))
    .add_system(render.after(move_enemies))
    .add_system(hud.priority(10)); // runs before other unconstrained systems

Required Methods§

Source

fn after<S2, P2>(self, other: S2) -> SystemConfig<Self, Params>
where S2: IntoSystem<P2> + 'static,

Wraps this system with a constraint that it must run after other.

Source

fn before<S2, P2>(self, other: S2) -> SystemConfig<Self, Params>
where S2: IntoSystem<P2> + 'static,

Wraps this system with a constraint that it must run before other.

Source

fn priority(self, priority: i32) -> SystemConfig<Self, Params>

Wraps this system with a priority — see SystemConfig::priority.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T, Params> IntoSystemConfig<Params> for T
where T: IntoSystem<Params> + 'static,