pub struct TaskPool<'s, T>(/* private fields */);
Expand description
A Bevy SystemParam
to execute many similar AsyncTask
s in the
background simultaneously.
Implementations§
Source§impl<T: ConditionalSend + 'static> TaskPool<'_, T>
impl<T: ConditionalSend + 'static> TaskPool<'_, T>
Trait Implementations§
Source§impl<T: Send + 'static> ExclusiveSystemParam for TaskPool<'_, T>
impl<T: Send + 'static> ExclusiveSystemParam for TaskPool<'_, T>
Source§type State = SyncCell<Vec<AsyncReceiver<T>>>
type State = SyncCell<Vec<AsyncReceiver<T>>>
Used to store data which persists across invocations of a system.
Source§type Item<'s> = TaskPool<'s, T>
type Item<'s> = TaskPool<'s, T>
The item type returned when constructing this system param.
See
SystemParam::Item
.Source§fn init(_world: &mut World, _system_meta: &mut SystemMeta) -> Self::State
fn init(_world: &mut World, _system_meta: &mut SystemMeta) -> Self::State
Creates a new instance of this param’s
State
.Source§fn get_param<'s>(
state: &'s mut Self::State,
_system_meta: &SystemMeta,
) -> Self::Item<'s>
fn get_param<'s>( state: &'s mut Self::State, _system_meta: &SystemMeta, ) -> Self::Item<'s>
Creates a parameter to be passed into an
ExclusiveSystemParamFunction
.Source§impl<T: Send + 'static> SystemParam for TaskPool<'_, T>
impl<T: Send + 'static> SystemParam for TaskPool<'_, T>
Source§type State = SyncCell<Vec<AsyncReceiver<T>>>
type State = SyncCell<Vec<AsyncReceiver<T>>>
Used to store data which persists across invocations of a system.
Source§type Item<'w, 's> = TaskPool<'s, T>
type Item<'w, 's> = TaskPool<'s, T>
The item type returned when constructing this system param.
The value of this associated type should be
Self
, instantiated with new lifetimes. Read moreSource§fn init_state(_world: &mut World, _system_meta: &mut SystemMeta) -> Self::State
fn init_state(_world: &mut World, _system_meta: &mut SystemMeta) -> Self::State
Registers any
World
access used by this SystemParam
and creates a new instance of this param’s State
.Source§unsafe fn get_param<'w, 's>(
state: &'s mut Self::State,
_system_meta: &SystemMeta,
_world: UnsafeWorldCell<'w>,
_change_tick: Tick,
) -> Self::Item<'w, 's>
unsafe fn get_param<'w, 's>( state: &'s mut Self::State, _system_meta: &SystemMeta, _world: UnsafeWorldCell<'w>, _change_tick: Tick, ) -> Self::Item<'w, 's>
Creates a parameter to be passed into a
SystemParamFunction
. Read moreSource§unsafe fn new_archetype(
state: &mut Self::State,
archetype: &Archetype,
system_meta: &mut SystemMeta,
)
unsafe fn new_archetype( state: &mut Self::State, archetype: &Archetype, system_meta: &mut SystemMeta, )
For the specified
Archetype
, registers the components accessed by this SystemParam
(if applicable).a Read moreSource§fn apply(state: &mut Self::State, system_meta: &SystemMeta, world: &mut World)
fn apply(state: &mut Self::State, system_meta: &SystemMeta, world: &mut World)
Applies any deferred mutations stored in this
SystemParam
’s state.
This is used to apply Commands
during ApplyDeferred
.Source§fn queue(
state: &mut Self::State,
system_meta: &SystemMeta,
world: DeferredWorld<'_>,
)
fn queue( state: &mut Self::State, system_meta: &SystemMeta, world: DeferredWorld<'_>, )
Queues any deferred mutations to be applied at the next
ApplyDeferred
.Source§unsafe fn validate_param(
state: &Self::State,
system_meta: &SystemMeta,
world: UnsafeWorldCell<'_>,
) -> Result<(), SystemParamValidationError>
unsafe fn validate_param( state: &Self::State, system_meta: &SystemMeta, world: UnsafeWorldCell<'_>, ) -> Result<(), SystemParamValidationError>
impl<T: Send + 'static> ReadOnlySystemParam for TaskPool<'_, T>
Auto Trait Implementations§
impl<'s, T> Freeze for TaskPool<'s, T>
impl<'s, T> !RefUnwindSafe for TaskPool<'s, T>
impl<'s, T> Send for TaskPool<'s, T>where
T: Send,
impl<'s, T> Sync for TaskPool<'s, T>where
T: Send,
impl<'s, T> Unpin for TaskPool<'s, T>
impl<'s, T> !UnwindSafe for TaskPool<'s, T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more