[−][src]Struct bevy_tasks::prelude::AsyncComputeTaskPool
A newtype for a task pool for CPU-intensive work that may span across multiple frames
Methods from Deref<Target = TaskPool>
pub fn thread_num(&self) -> usize
[src]
Return the number of threads owned by the task pool
pub fn scope<'scope, F, T>(&self, f: F) -> Vec<T> where
F: FnOnce(&mut Scope<'scope, T>) + 'scope + Send,
T: Send + 'static,
[src]
F: FnOnce(&mut Scope<'scope, T>) + 'scope + Send,
T: Send + 'static,
Allows spawning non-`static futures on the thread pool. The function takes a callback, passing a scope object into it. The scope object provided to the callback can be used to spawn tasks. This function will await the completion of all tasks before returning.
This is similar to rayon::scope
and crossbeam::scope
pub fn spawn<T>(
&self,
future: impl Future<Output = T> + Send + 'static
) -> Task<T>ⓘ where
T: Send + 'static,
[src]
&self,
future: impl Future<Output = T> + Send + 'static
) -> Task<T>ⓘ where
T: Send + 'static,
Spawns a static future onto the thread pool. The returned Task is a future. It can also be cancelled and "detached" allowing it to continue running without having to be polled by the end-user.
Trait Implementations
impl Clone for AsyncComputeTaskPool
[src]
pub fn clone(&self) -> AsyncComputeTaskPool
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for AsyncComputeTaskPool
[src]
impl Deref for AsyncComputeTaskPool
[src]
Auto Trait Implementations
impl !RefUnwindSafe for AsyncComputeTaskPool
[src]
impl Send for AsyncComputeTaskPool
[src]
impl Sync for AsyncComputeTaskPool
[src]
impl Unpin for AsyncComputeTaskPool
[src]
impl !UnwindSafe for AsyncComputeTaskPool
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,