pub struct JoinHandle<T: Send + 'static> { /* private fields */ }
Expand description
A handle used to wait on a coroutine’s termination.
Implementations§
Source§impl<T: Send + 'static> JoinHandle<T>
impl<T: Send + 'static> JoinHandle<T>
Sourcepub fn join(self) -> Result<T, Box<dyn Any + Send>>
pub fn join(self) -> Result<T, Box<dyn Any + Send>>
Waits for the associated coroutine to finish.
If the associated coroutine has already terminated,
join
returns instantly with the result.
Otherwise, join
waits until the coroutine terminates.
If the child coroutine panics, Err
is returned with the
boxed value passed to panic
. Otherwise, Ok
is returned
with the return value of the closure executed in the coroutine.
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>
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