[−]Struct amethyst::ecs::prelude::Dispatcher
The dispatcher struct, allowing systems to be executed in parallel.
Methods
impl<'a, 'b> Dispatcher<'a, 'b>
impl<'a, 'b> Dispatcher<'a, 'b>pub fn setup(&mut self, res: &mut Resources)
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)
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_parin case it is supporteddispatch_seqotherwise
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)
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)
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)
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>
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>Blanket Implementations
impl<T, U> Into for T where
U: From<T>, [src]
impl<T, U> Into for T where
U: From<T>, impl<T> From for T[src]
impl<T> From for Timpl<T, U> TryFrom for T where
T: From<U>, [src]
impl<T, U> TryFrom for T where
T: From<U>, type Error = !
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>try_from)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized, [src]
impl<T> Borrow for T where
T: ?Sized, impl<T> BorrowMut for T where
T: ?Sized, [src]
impl<T> BorrowMut for T where
T: ?Sized, fn borrow_mut(&mut self) -> &mut T[src]
fn borrow_mut(&mut self) -> &mut TMutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
impl<T, U> TryInto for T where
U: TryFrom<T>, type Error = <U as TryFrom<T>>::Error
try_from)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>try_from)Performs the conversion.
impl<T> Any for T where
T: 'static + ?Sized, [src]
impl<T> Any for T where
T: 'static + ?Sized, fn get_type_id(&self) -> TypeId[src]
fn get_type_id(&self) -> TypeId🔬 This is a nightly-only experimental API. (get_type_id)
this method will likely be replaced by an associated static
Gets the TypeId of self. Read more
impl<'a, T> RunNow for T where
T: System<'a>,
impl<'a, T> RunNow for T where
T: System<'a>, fn run_now(&mut self, res: &'a Resources)
fn run_now(&mut self, res: &'a Resources)Runs the system now. Read more
fn setup(&mut self, res: &mut Resources)
fn setup(&mut self, res: &mut Resources)Sets up Resources for a later call to run_now.
impl<T> Any for T where
T: Any,
impl<T> Any for T where
T: Any, fn get_type_id(&self) -> TypeId
fn get_type_id(&self) -> TypeIdimpl<T> Erased for T
impl<T> Erased for Timpl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any, fn into_any(self: Box<T>) -> Box<dyn Any + 'static>
fn into_any(self: Box<T>) -> Box<dyn Any + 'static>Convert Box<Trait> (where Trait: Downcast) to Box<Any>. Box<Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more
fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any's vtable from &Trait's. Read more
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any's vtable from &mut Trait's. Read more
impl<T> SetParameter for T
impl<T> SetParameter for Tfn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>, Sets value as a parameter of self.