pub struct TaskHandle<Output> {
pub task_id: TaskId,
/* private fields */
}Expand description
A handle to a task that has been submitted to the system.
This is the public-facing handle (wrapped by Job) that allows a user
to retrieve the result of their function once it’s complete.
Fields§
§task_id: TaskIdImplementations§
Source§impl<Output> TaskHandle<Output>
impl<Output> TaskHandle<Output>
Sourcepub fn get_task_id(&self) -> TaskId
pub fn get_task_id(&self) -> TaskId
Returns the unique ID of the associated task.
Sourcepub fn recv_result(&self) -> Result<Result<Output, TaskError>, RecvError>
pub fn recv_result(&self) -> Result<Result<Output, TaskError>, RecvError>
Waits (blocks) until the task’s result is available and returns it.
Sourcepub fn try_recv_result(&self) -> Result<Result<Output, TaskError>, TryRecvError>
pub fn try_recv_result(&self) -> Result<Result<Output, TaskError>, TryRecvError>
Attempts to receive the result without blocking.
Trait Implementations§
Auto Trait Implementations§
impl<Output> Freeze for TaskHandle<Output>
impl<Output> RefUnwindSafe for TaskHandle<Output>
impl<Output> Send for TaskHandle<Output>where
Output: Send,
impl<Output> !Sync for TaskHandle<Output>
impl<Output> Unpin for TaskHandle<Output>
impl<Output> UnwindSafe for TaskHandle<Output>
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