pub struct TaskHandle<O: Clone + Send + 'static> {
pub id: Uuid,
/* private fields */
}Expand description
Handle returned to a caller after submitting a task to the pool.
result()awaits the final task output.events()returns a broadcast receiver for intermediateEvents.cancel()requests cooperative cancellation.
Fields§
§id: UuidUnique identifier assigned to this task by the pool.
Implementations§
Source§impl<O: Clone + Send + 'static> TaskHandle<O>
impl<O: Clone + Send + 'static> TaskHandle<O>
Sourcepub fn events(&self) -> Receiver<Event<O>>
pub fn events(&self) -> Receiver<Event<O>>
Get a new broadcast receiver for intermediate events.
Sourcepub fn cancel_token(&self) -> CancellationToken
pub fn cancel_token(&self) -> CancellationToken
Clone the cancellation token so it can be stored separately
(e.g., for cancelling after the handle is consumed by result()).
Auto Trait Implementations§
impl<O> !RefUnwindSafe for TaskHandle<O>
impl<O> !UnwindSafe for TaskHandle<O>
impl<O> Freeze for TaskHandle<O>
impl<O> Send for TaskHandle<O>
impl<O> Sync for TaskHandle<O>
impl<O> Unpin for TaskHandle<O>
impl<O> UnsafeUnpin for TaskHandle<O>
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