Struct specs::prelude::Dispatcher [−][src]
pub struct Dispatcher<'a, 'b> { /* fields omitted */ }
The dispatcher struct, allowing systems to be executed in parallel.
Methods
impl<'a, 'b> Dispatcher<'a, 'b>
[src]
impl<'a, 'b> Dispatcher<'a, 'b>
pub fn setup(&mut self, res: &mut Resources)
[src]
pub fn setup(&mut self, res: &mut Resources)
Sets up all the systems which means they are gonna add default values for the resources they need.
pub fn dispatch(&mut self, res: &Resources)
[src]
pub fn dispatch(&mut self, res: &Resources)
Dispatch all the systems with given resources and context and then run thread local systems.
This function automatically redirects to
dispatch_par
in case it is supporteddispatch_seq
otherwise
and runs dispatch_thread_local
afterwards.
Please note that this method assumes that no resource is currently borrowed. If that's the case, it panics.
pub fn dispatch_par(&mut self, res: &Resources)
[src]
pub fn dispatch_par(&mut self, res: &Resources)
Dispatches the systems (except thread local systems) in parallel given the resources to operate on.
This operation blocks the executing thread.
Only available with "parallel" feature enabled.
Please note that this method assumes that no resource is currently borrowed. If that's the case, it panics.
pub fn dispatch_seq(&mut self, res: &Resources)
[src]
pub fn dispatch_seq(&mut self, res: &Resources)
Dispatches the systems (except thread local systems) sequentially.
This is useful if parallel overhead is too big or the platform does not support multithreading.
Please note that this method assumes that no resource is currently borrowed. If that's the case, it panics.
pub fn dispatch_thread_local(&mut self, res: &Resources)
[src]
pub fn dispatch_thread_local(&mut self, res: &Resources)
Dispatch only thread local systems sequentially.
Please note that this method assumes that no resource is currently borrowed. If that's the case, it panics.
Trait Implementations
impl<'a, 'b, 'c> RunNow<'a> for Dispatcher<'b, 'c>
[src]
impl<'a, 'b, 'c> RunNow<'a> for Dispatcher<'b, 'c>
Auto Trait Implementations
impl<'a, 'b> !Send for Dispatcher<'a, 'b>
impl<'a, 'b> !Send for Dispatcher<'a, 'b>
impl<'a, 'b> !Sync for Dispatcher<'a, 'b>
impl<'a, 'b> !Sync for Dispatcher<'a, 'b>