pub struct Schedule { /* private fields */ }
Expand description
A schedule of systems to execute with automatic parallelization.
Implementations§
source§impl Schedule
impl Schedule
sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new empty schedule, prefer Self::builder
sourcepub fn builder() -> ScheduleBuilder
pub fn builder() -> ScheduleBuilder
Creates a new schedule builder
sourcepub fn execute_seq(&mut self, world: &mut World) -> Result<()>
pub fn execute_seq(&mut self, world: &mut World) -> Result<()>
Execute all systems in the schedule sequentially on the world. Returns the first error and aborts if the execution fails.
sourcepub fn execute_par(&mut self, world: &mut World) -> Result<()>
Available on crate feature rayon
only.
pub fn execute_par(&mut self, world: &mut World) -> Result<()>
rayon
only.Executes the systems in the schedule in parallel.
Systems will run in an order such that changes and mutable accesses made by systems provided before are observable when the system runs.
Systems with no dependencies between each other may run in any order, but will not run before any previously provided system which it depends on.
A dependency between two systems is given by a side effect, e.g; a component write, which is accessed by the seconds system through a read or other side effect.
sourcepub fn from_systems(systems: impl Into<Vec<BoxedSystem>>) -> Self
pub fn from_systems(systems: impl Into<Vec<BoxedSystem>>) -> Self
Creates a schedule from a group of existing systems
sourcepub fn with_system(self, system: impl Into<BoxedSystem>) -> Self
pub fn with_system(self, system: impl Into<BoxedSystem>) -> Self
Add a new system to the schedule. Respects order.
sourcepub fn batch_info(&mut self, world: &World) -> BatchInfos
pub fn batch_info(&mut self, world: &World) -> BatchInfos
Returns information about the current multithreaded batch partioning and system accesses.
sourcepub fn execute_seq_with<'a>(
&'a mut self,
world: &'a mut World,
input: impl IntoInput<'a>
) -> Result<()>
pub fn execute_seq_with<'a>( &'a mut self, world: &'a mut World, input: impl IntoInput<'a> ) -> Result<()>
Same as Self::execute_seq
but allows supplying short lived input available to the systems
The data can be a mutable reference type, or a tuple of mutable references
sourcepub fn execute_par_with<'a>(
&'a mut self,
world: &'a mut World,
input: impl IntoInput<'a>
) -> Result<()>
Available on crate feature rayon
only.
pub fn execute_par_with<'a>( &'a mut self, world: &'a mut World, input: impl IntoInput<'a> ) -> Result<()>
rayon
only.Same as Self::execute_par
but allows supplying short lived data available to the systems