Struct std::thread::pool::TaskHandle
A handle that allow to wait on tasks spawned on a thread pool.
Fields
-
inner: &mut JoinableTask<T>
Methods
impl TaskHandle<T> { ... }
-
fn wait(self: &TaskHandle<T>) -> T
Returns the result of the task.
If the task has not completed yet, this method will block the current thread.
-
fn try_wait(self: &TaskHandle<T>) -> Result<T, ChannelError>
Tries to return the result of the task.
This method will not block the current thread. If the task has not completed yet, this method will return WouldBlock.
-
fn detach(self: &TaskHandle<T>)
Ignores the result of the task.
This will free the resources associated with the task.