Struct specs::Planner
[−]
[src]
pub struct Planner<C> { pub systems: Vec<SystemInfo<C>>, // some fields omitted }
System execution planner. Allows running systems via closures, distributes the load in parallel using a thread pool.
Fields
systems: Vec<SystemInfo<C>>
Permanent systems in the planner.
Methods
impl<C: 'static> Planner<C>
[src]
fn new(world: World) -> Planner<C>
Creates a new planner from a given world.
If you already have a ThreadPool
, consider using from_pool
instead.
If you want to specify the number of threads, use with_num_threads
.
The number of threads will be equal to the number of virtual cores.
fn with_num_threads(world: World, num_threads: usize) -> Planner<C>
Creates a new planner with a thread pool that has
num_threads
threads.
fn from_pool(world: World, pool: Arc<ThreadPool>) -> Planner<C>
Creates a new Planner
from a given
thread pool.
fn add_system<S>(&mut self, sys: S, name: &str, priority: Priority) where
S: 'static + System<C>,
S: 'static + System<C>,
Add a system to the dispatched list.
fn run_custom<F>(&mut self, functor: F) where
F: 'static + Send + FnOnce(RunArg),
F: 'static + Send + FnOnce(RunArg),
Runs a custom system.
fn mut_world(&mut self) -> &mut World
Waits for all currently executing systems to finish and then returns the mutable borrow of the world, allowing to create entities instantly.
fn wait(&mut self)
Waits for all currently executing systems to finish and then merges all queued changes.
impl<C: Clone + Send + 'static> Planner<C>
[src]
fn dispatch(&mut self, context: C)
Dispatch all systems according to their associated priorities.
impl<C: 'static> Planner<C>
[src]
fn run0w1r<R0, F: 'static + Send + FnMut(&R0)>(&mut self, functor: F) where
R0: Component,
R0: Component,
fn run0w2r<R0, R1, F: 'static + Send + FnMut(&R0, &R1)>(&mut self, functor: F) where
R0: Component,
R1: Component,
R0: Component,
R1: Component,
fn run0w3r<R0, R1, R2, F: 'static + Send + FnMut(&R0, &R1, &R2)>(
&mut self,
functor: F
) where
R0: Component,
R1: Component,
R2: Component,
&mut self,
functor: F
) where
R0: Component,
R1: Component,
R2: Component,
fn run0w4r<R0, R1, R2, R3, F: 'static + Send + FnMut(&R0, &R1, &R2, &R3)>(
&mut self,
functor: F
) where
R0: Component,
R1: Component,
R2: Component,
R3: Component,
&mut self,
functor: F
) where
R0: Component,
R1: Component,
R2: Component,
R3: Component,
fn run1w0r<W0, F: 'static + Send + FnMut(&mut W0)>(&mut self, functor: F) where
W0: Component,
W0: Component,
fn run1w1r<W0, R0, F: 'static + Send + FnMut(&mut W0, &R0)>(
&mut self,
functor: F
) where
W0: Component,
R0: Component,
&mut self,
functor: F
) where
W0: Component,
R0: Component,
fn run1w2r<W0, R0, R1, F: 'static + Send + FnMut(&mut W0, &R0, &R1)>(
&mut self,
functor: F
) where
W0: Component,
R0: Component,
R1: Component,
&mut self,
functor: F
) where
W0: Component,
R0: Component,
R1: Component,
fn run1w3r<W0, R0, R1, R2, F: 'static + Send + FnMut(&mut W0, &R0, &R1, &R2)>(
&mut self,
functor: F
) where
W0: Component,
R0: Component,
R1: Component,
R2: Component,
&mut self,
functor: F
) where
W0: Component,
R0: Component,
R1: Component,
R2: Component,
fn run1w4r<W0, R0, R1, R2, R3, F: 'static + Send + FnMut(&mut W0, &R0, &R1, &R2, &R3)>(
&mut self,
functor: F
) where
W0: Component,
R0: Component,
R1: Component,
R2: Component,
R3: Component,
&mut self,
functor: F
) where
W0: Component,
R0: Component,
R1: Component,
R2: Component,
R3: Component,
fn run1w5r<W0, R0, R1, R2, R3, R4, F: 'static + Send + FnMut(&mut W0, &R0, &R1, &R2, &R3, &R4)>(
&mut self,
functor: F
) where
W0: Component,
R0: Component,
R1: Component,
R2: Component,
R3: Component,
R4: Component,
&mut self,
functor: F
) where
W0: Component,
R0: Component,
R1: Component,
R2: Component,
R3: Component,
R4: Component,
fn run1w6r<W0, R0, R1, R2, R3, R4, R5, F: 'static + Send + FnMut(&mut W0, &R0, &R1, &R2, &R3, &R4, &R5)>(
&mut self,
functor: F
) where
W0: Component,
R0: Component,
R1: Component,
R2: Component,
R3: Component,
R4: Component,
R5: Component,
&mut self,
functor: F
) where
W0: Component,
R0: Component,
R1: Component,
R2: Component,
R3: Component,
R4: Component,
R5: Component,
fn run1w7r<W0, R0, R1, R2, R3, R5, R6, R7, F: 'static + Send + FnMut(&mut W0, &R0, &R1, &R2, &R3, &R5, &R6, &R7)>(
&mut self,
functor: F
) where
W0: Component,
R0: Component,
R1: Component,
R2: Component,
R3: Component,
R5: Component,
R6: Component,
R7: Component,
&mut self,
functor: F
) where
W0: Component,
R0: Component,
R1: Component,
R2: Component,
R3: Component,
R5: Component,
R6: Component,
R7: Component,
fn run2w0r<W0, W1, F: 'static + Send + FnMut(&mut W0, &mut W1)>(
&mut self,
functor: F
) where
W0: Component,
W1: Component,
&mut self,
functor: F
) where
W0: Component,
W1: Component,
fn run2w1r<W0, W1, R0, F: 'static + Send + FnMut(&mut W0, &mut W1, &R0)>(
&mut self,
functor: F
) where
W0: Component,
W1: Component,
R0: Component,
&mut self,
functor: F
) where
W0: Component,
W1: Component,
R0: Component,
fn run2w2r<W0, W1, R0, R1, F: 'static + Send + FnMut(&mut W0, &mut W1, &R0, &R1)>(
&mut self,
functor: F
) where
W0: Component,
W1: Component,
R0: Component,
R1: Component,
&mut self,
functor: F
) where
W0: Component,
W1: Component,
R0: Component,
R1: Component,