pub struct WebTask<T> { /* private fields */ }
Available on crate feature
web
only.Expand description
Task wrapper for web/WASM environment.
This task type provides task management for web environments where panic catching is not available. Unlike other task implementations, panics cannot be caught and will terminate the entire WASM module.
This is a simple wrapper that just awaits the spawned future directly.
Trait Implementations§
Source§impl<T: 'static> Task<T> for WebTask<T>
impl<T: 'static> Task<T> for WebTask<T>
Source§fn poll_result(
self: Pin<&mut Self>,
_cx: &mut Context<'_>,
) -> Poll<Result<T, Box<dyn Any + Send>>>
fn poll_result( self: Pin<&mut Self>, _cx: &mut Context<'_>, ) -> Poll<Result<T, Box<dyn Any + Send>>>
Source§fn poll_cancel(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<()>
fn poll_cancel(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<()>
Poll for task cancellation. Read more
Source§fn result(self) -> impl Future<Output = Result<T, Box<dyn Any + Send>>>where
Self: Sized,
fn result(self) -> impl Future<Output = Result<T, Box<dyn Any + Send>>>where
Self: Sized,
Get the result of the task, including any errors that occurred. Read more
Auto Trait Implementations§
impl<T> Freeze for WebTask<T>
impl<T> RefUnwindSafe for WebTask<T>where
T: RefUnwindSafe,
impl<T> Send for WebTask<T>where
T: Send,
impl<T> Sync for WebTask<T>where
T: Sync,
impl<T> Unpin for WebTask<T>where
T: Unpin,
impl<T> UnwindSafe for WebTask<T>where
T: UnwindSafe,
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<F> FutureExt for F
impl<F> FutureExt for F
Source§impl<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere
F: Future,
Source§type IntoFuture = F
type IntoFuture = F
Which kind of future are we turning this into?
Source§fn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Creates a future from a value. Read more