Handle returned by
that allows to block the current thread and wait for the result of a submitted task. The returned
JoinHandle may also be sent to the
to create a task that blocks a worker thread until the task is completed and then does something with the result. This handle communicates with the worker thread
using a oneshot channel blocking the thread when
try_await_complete() is called until a message, i.e. the result of the
task, is received.
impl<T: Send> JoinHandle<T>[src]
pub fn try_await_complete(self) -> Result<T, Canceled>[src]
Block the current thread until the result of the task is received.
This function might return a
oneshot::Canceled if the channel was broken
before the result was received. This is generally the case if execution of
the task panicked.
pub fn await_complete(self) -> T[src]
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>
type Error = Infallible
The type returned in the event of a conversion error.