pub struct AsyncTask<T: ConditionalSend> { /* private fields */ }Expand description
A wrapper type around an async future. The future may be executed
asynchronously by an TaskRunner or
TaskPool bevy system parameter.
Implementations§
Source§impl<T> AsyncTask<T>where
T: ConditionalSend + 'static,
impl<T> AsyncTask<T>where
T: ConditionalSend + 'static,
Sourcepub fn split(self) -> (Pin<Box<impl Future<Output = ()>>>, AsyncReceiver<T>)
pub fn split(self) -> (Pin<Box<impl Future<Output = ()>>>, AsyncReceiver<T>)
Split the task into a runnable future and receiver. This is a low-level operation and only useful for specific needs.
Sourcepub fn with_timeout(self, dur: Duration) -> TimedAsyncTask<T>
pub fn with_timeout(self, dur: Duration) -> TimedAsyncTask<T>
Add a timeout for this task.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for AsyncTask<T>
impl<T> !RefUnwindSafe for AsyncTask<T>
impl<T> Send for AsyncTask<T>
impl<T> !Sync for AsyncTask<T>
impl<T> Unpin for AsyncTask<T>
impl<T> !UnwindSafe for AsyncTask<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.