pub struct Task<T, B: QueueBacking> { /* private fields */ }Expand description
A handle to a queued group of work units, which output a single result.
Implementations§
source§impl<T, B: QueueBacking> Task<T, B>
impl<T, B: QueueBacking> Task<T, B>
sourcepub fn cancel(self)
pub fn cancel(self)
Cancels this task, preventing any further threads from performing its work.
sourcepub fn result(self) -> Result<T, Self>
pub fn result(self) -> Result<T, Self>
Attempts to get the result of this task if it has been completed. Otherwise, returns the original task.
Trait Implementations§
Auto Trait Implementations§
impl<T, B> !RefUnwindSafe for Task<T, B>
impl<T, B> Send for Task<T, B>
impl<T, B> Sync for Task<T, B>
impl<T, B> Unpin for Task<T, B>
impl<T, B> !UnwindSafe for Task<T, B>
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
source§impl<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere F: Future,
§type IntoFuture = F
type IntoFuture = F
Which kind of future are we turning this into?
source§fn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Creates a future from a value. Read more