Struct specs::AsyncDispatcher

source ·
pub struct AsyncDispatcher<'a, R> { /* private fields */ }
Expand description

Like, Dispatcher but works asynchronously.

Implementations§

source§

impl<'a, R> AsyncDispatcher<'a, R>where R: Borrow<World> + Send + Sync + 'static,

source

pub fn setup(&mut self)where R: BorrowMut<World>,

Sets up all the systems which means they are gonna add default values for the resources they need.

source

pub fn dispatch(&mut self)

Dispatches the systems asynchronously. Does not execute thread local systems.

If you want to wait for the systems to finish, call wait().

source

pub fn wait(&mut self)

Waits for all the asynchronously dispatched systems to finish and executes thread local systems (if there are any).

source

pub fn wait_without_tl(&mut self)

Waits for all the asynchronously dispatched systems to finish without executing thread local systems.

See wait for executing thread local systems.

source

pub fn running(&mut self) -> bool

Checks if any of the asynchronously dispatched systems are running.

source

pub fn res(&mut self) -> &R

👎Deprecated since 0.8.0: renamed to world

Returns the World.

This will wait for the asynchronous systems to finish.

Renamed to self.world().

source

pub fn world(&mut self) -> &R

Returns the World.

This will wait for the asynchronous systems to finish.

source

pub fn mut_res(&mut self) -> &mut R

👎Deprecated since 0.8.0: renamed to world_mut

Borrows the World mutably.

This will wait for the asynchronous systems to finish.

Renamed to self.world_mut().

source

pub fn world_mut(&mut self) -> &mut R

Borrows the World mutably.

This will wait for the asynchronous systems to finish.

Auto Trait Implementations§

§

impl<'a, R> !RefUnwindSafe for AsyncDispatcher<'a, R>

§

impl<'a, R> !Send for AsyncDispatcher<'a, R>

§

impl<'a, R> !Sync for AsyncDispatcher<'a, R>

§

impl<'a, R> Unpin for AsyncDispatcher<'a, R>where R: Unpin,

§

impl<'a, R> !UnwindSafe for AsyncDispatcher<'a, R>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.