Struct web_thread::JoinHandle
source · pub struct JoinHandle<T>(/* private fields */);
Expand description
Implementations§
source§impl<T> JoinHandle<T>
impl<T> JoinHandle<T>
sourcepub fn is_finished(&self) -> bool
pub fn is_finished(&self) -> bool
See std::thread::JoinHandle::is_finished()
.
§Notes
When this returns true
it guarantees JoinHandle::join()
not to
block.
sourcepub fn join(self) -> Result<T>
pub fn join(self) -> Result<T>
See std::thread::JoinHandle::join()
.
§Notes
When compiling with panic = "abort"
, which is the only option
without enabling the Wasm exception-handling proposal, this can never
return Err
.
§Panics
- If the calling thread doesn’t support blocking, see
web::has_block_support()
. Though it is guaranteed to not block ifJoinHandle::is_finished()
returnstrue
. Alternatively consider usingweb::JoinHandleExt::join_async()
. - If called on the thread to join.
- If it was already polled to completion through
web::JoinHandleExt::join_async()
.
Trait Implementations§
source§impl<T> Debug for JoinHandle<T>
impl<T> Debug for JoinHandle<T>
source§impl<T> JoinHandleExt<T> for JoinHandle<T>
Available on Web
only.
impl<T> JoinHandleExt<T> for JoinHandle<T>
Available on
Web
only.source§fn join_async(&mut self) -> JoinHandleFuture<'_, T> ⓘ
fn join_async(&mut self) -> JoinHandleFuture<'_, T> ⓘ
Async version of
JoinHandle::join()
. Read moreAuto Trait Implementations§
impl<T> Freeze for JoinHandle<T>
impl<T> !RefUnwindSafe for JoinHandle<T>
impl<T> Send for JoinHandle<T>
impl<T> Sync for JoinHandle<T>
impl<T> Unpin for JoinHandle<T>
impl<T> !UnwindSafe for JoinHandle<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