pub struct TimedTaskPool<'s, T>(/* private fields */);Expand description
A Bevy SystemParam to execute many similar AsyncTasks in the
background simultaneously.
Implementations§
Source§impl<T: ConditionalSend + 'static> TimedTaskPool<'_, T>
impl<T: ConditionalSend + 'static> TimedTaskPool<'_, T>
Sourcepub fn spawn(&mut self, task: impl Into<TimedAsyncTask<T>>)
pub fn spawn(&mut self, task: impl Into<TimedAsyncTask<T>>)
Spawn an async task in the background.
Trait Implementations§
Source§impl<'s, T: Debug> Debug for TimedTaskPool<'s, T>
impl<'s, T: Debug> Debug for TimedTaskPool<'s, T>
Source§impl<T: Send + 'static> ExclusiveSystemParam for TimedTaskPool<'_, T>
impl<T: Send + 'static> ExclusiveSystemParam for TimedTaskPool<'_, T>
Source§type State = SyncCell<Vec<AsyncReceiver<Result<T, TimeoutError>>>>
type State = SyncCell<Vec<AsyncReceiver<Result<T, TimeoutError>>>>
Used to store data which persists across invocations of a system.
Source§type Item<'s> = TimedTaskPool<'s, T>
type Item<'s> = TimedTaskPool<'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 TimedTaskPool<'_, T>
impl<T: Send + 'static> SystemParam for TimedTaskPool<'_, T>
Source§type State = SyncCell<Vec<AsyncReceiver<Result<T, TimeoutError>>>>
type State = SyncCell<Vec<AsyncReceiver<Result<T, TimeoutError>>>>
Used to store data which persists across invocations of a system.
Source§type Item<'w, 's> = TimedTaskPool<'s, T>
type Item<'w, 's> = TimedTaskPool<'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) -> Self::State
fn init_state(_world: &mut World) -> Self::State
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§fn init_access(
_state: &Self::State,
_system_meta: &mut SystemMeta,
_component_access_set: &mut FilteredAccessSet,
_world: &mut World,
)
fn init_access( _state: &Self::State, _system_meta: &mut SystemMeta, _component_access_set: &mut FilteredAccessSet, _world: &mut World, )
Registers any
World access used by this SystemParamSource§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: &mut Self::State,
system_meta: &SystemMeta,
world: UnsafeWorldCell<'_>,
) -> Result<(), SystemParamValidationError>
unsafe fn validate_param( state: &mut Self::State, system_meta: &SystemMeta, world: UnsafeWorldCell<'_>, ) -> Result<(), SystemParamValidationError>
impl<T: Send + 'static> ReadOnlySystemParam for TimedTaskPool<'_, T>
Auto Trait Implementations§
impl<'s, T> Freeze for TimedTaskPool<'s, T>
impl<'s, T> !RefUnwindSafe for TimedTaskPool<'s, T>
impl<'s, T> Send for TimedTaskPool<'s, T>where
T: Send,
impl<'s, T> Sync for TimedTaskPool<'s, T>where
T: Send,
impl<'s, T> Unpin for TimedTaskPool<'s, T>
impl<'s, T> !UnwindSafe for TimedTaskPool<'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
Source§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Converts this type into the system output type.