Struct coroutines::JoinHandle
[−]
[src]
pub struct JoinHandle<T: Send + 'static> { /* fields omitted */ }
A handle used to wait on a coroutine's termination.
Methods
impl<T: Send + 'static> JoinHandle<T>
[src]
fn join(self) -> Result<T, Box<Any + Send>>
[src]
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.