pub struct Schedule { /* private fields */ }Expand description
Stage-based system scheduler.
Systems are grouped into stages. Stages run in the order they were first registered. Within a stage, systems run in registration order.
Systems are parameterized functions that declare their data access via
SystemParam.
Implementations§
Source§impl Schedule
impl Schedule
pub fn new() -> Self
Sourcepub fn add_system<P>(
&mut self,
stage: &'static str,
name: &'static str,
func: impl IntoSystem<P>,
) -> &mut Self
pub fn add_system<P>( &mut self, stage: &'static str, name: &'static str, func: impl IntoSystem<P>, ) -> &mut Self
Add a system to a named stage.
Accepts any function that implements IntoSystem — parameterized
functions like fn(Res<T>, QueryMut<U>).
Sourcepub fn run(&mut self, world: &mut World)
pub fn run(&mut self, world: &mut World)
Run all systems in stage order.
Execution order each tick:
- Drain deadlines — fires all overdue deadlines into Events
current. - Advance event buffers —
current→previous(fired deadlines become readable), oldpreviouscleared. - Run systems by stage —
EventReadersees fired deadlines + any events from the previous tick. Commands applied between stages.
Sourcepub fn system_count(&self) -> usize
pub fn system_count(&self) -> usize
Returns the number of registered systems.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Schedule
impl !Send for Schedule
impl !Sync for Schedule
impl !UnwindSafe for Schedule
impl Freeze for Schedule
impl Unpin for Schedule
impl UnsafeUnpin for Schedule
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more