Trait web_thread::web::ScopedJoinHandleExt
source · pub trait ScopedJoinHandleExt<'scope, T> {
// Required method
fn join_async<'handle>(
&'handle mut self,
) -> ScopedJoinHandleFuture<'handle, 'scope, T> ⓘ;
}
Available on
Web
only.Expand description
Web-specific extension for
web_thread::ScopedJoinHandle
.
Required Methods§
sourcefn join_async<'handle>(
&'handle mut self,
) -> ScopedJoinHandleFuture<'handle, 'scope, T> ⓘ
fn join_async<'handle>( &'handle mut self, ) -> ScopedJoinHandleFuture<'handle, 'scope, T> ⓘ
Async version of ScopedJoinHandle::join()
.
§Panics
- If called on the thread to join.
- If it was already polled to completion by another call to
ScopedJoinHandleExt::join_async()
.
§Example
use web_thread::web::{self, ScopedJoinHandleExt};
web::scope_async(|scope| async {
scope.spawn(|| ()).join_async().await.unwrap();
}).await;