pub struct JoinHandle<T: Send + 'static> { /* private fields */ }
Expand description
Handle for joining a thread
Implementations§
Source§impl<T: Send + 'static> JoinHandle<T>
impl<T: Send + 'static> JoinHandle<T>
Sourcepub fn join(self) -> Result<T, JoinError>
pub fn join(self) -> Result<T, JoinError>
Join the thread. Block the current thread until the thread is finished.
Returns the value returned by the thread closure. If the thread panicked,
this returns a JoinError
.
§Unwind and Poisoning
Note that wasm32-unknown-unknown
target does not support unwinding yet.
This means safety mechanisms like poisoning are not available. Panicking
while holding a lock will not release the lock and will likely produce a dead lock.
Auto 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>where
T: Unpin,
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