Struct ffi_helpers::task::TaskHandle [−][src]
pub struct TaskHandle<T> { /* fields omitted */ }
Expand description
An opaque handle to some task which is running in the background.
Implementations
pub fn spawn<K>(task: K) -> TaskHandle<T> where
K: Task<Output = T> + UnwindSafe + Send + Sync + 'static,
T: Send + Sync + 'static,
pub fn spawn<K>(task: K) -> TaskHandle<T> where
K: Task<Output = T> + UnwindSafe + Send + Sync + 'static,
T: Send + Sync + 'static,
Spawn a Task
in the background, returning the a TaskHandle
so you
can cancel it or retrieve the result later on.
Check if the background task has finished.
If the other end hangs up for whatever reason this will return an error.
Block the current thread until the task has finished and returned a result.