pub struct TrackedTask<R, E> { /* private fields */ }Expand description
Result handle with active status tracking and pre-start cancellation.
Implementations§
Source§impl<R, E> TrackedTask<R, E>
impl<R, E> TrackedTask<R, E>
Sourcepub fn get(self) -> Result<R, TaskExecutionError<E>>
pub fn get(self) -> Result<R, TaskExecutionError<E>>
Sourcepub fn try_get(self) -> TryGet<TrackedTask<R, E>, R, E>
pub fn try_get(self) -> TryGet<TrackedTask<R, E>, R, E>
Attempts to retrieve the final result without blocking.
§Returns
A ready result or the pending tracked handle.
Sourcepub fn is_done(&self) -> bool
pub fn is_done(&self) -> bool
Returns whether the tracked task has installed a terminal state.
§Returns
true after the task succeeds, fails, panics, is cancelled, or loses
its completion endpoint. The final result send may still be racing with
this status observation.
Sourcepub fn status(&self) -> TaskStatus
pub fn status(&self) -> TaskStatus
Sourcepub fn cancel(&self) -> CancelResult
pub fn cancel(&self) -> CancelResult
Trait Implementations§
Source§impl<R, E> IntoFuture for TrackedTask<R, E>
impl<R, E> IntoFuture for TrackedTask<R, E>
Source§fn into_future(self) -> <TrackedTask<R, E> as IntoFuture>::IntoFuture
fn into_future(self) -> <TrackedTask<R, E> as IntoFuture>::IntoFuture
Converts this tracked handle into a future resolving to the task result.
Source§type Output = Result<R, TaskExecutionError<E>>
type Output = Result<R, TaskExecutionError<E>>
The output that the future will produce on completion.
Source§type IntoFuture = TaskHandleFuture<R, E>
type IntoFuture = TaskHandleFuture<R, E>
Which kind of future are we turning this into?
Source§impl<R, E> TaskResultHandle<R, E> for TrackedTask<R, E>
impl<R, E> TaskResultHandle<R, E> for TrackedTask<R, E>
Source§fn get(self) -> Result<R, TaskExecutionError<E>>
fn get(self) -> Result<R, TaskExecutionError<E>>
Blocks until the underlying result handle yields a result.
Source§fn try_get(self) -> TryGet<TrackedTask<R, E>, R, E>
fn try_get(self) -> TryGet<TrackedTask<R, E>, R, E>
Attempts to retrieve the underlying result without blocking.
Source§impl<R, E> TrackedTaskHandle<R, E> for TrackedTask<R, E>
impl<R, E> TrackedTaskHandle<R, E> for TrackedTask<R, E>
Source§fn status(&self) -> TaskStatus
fn status(&self) -> TaskStatus
Returns the currently observed task status.
Source§fn cancel(&self) -> CancelResult
fn cancel(&self) -> CancelResult
Attempts to publish a cancellation result while the task is pending.
Auto Trait Implementations§
impl<R, E> Freeze for TrackedTask<R, E>
impl<R, E> !RefUnwindSafe for TrackedTask<R, E>
impl<R, E> Send for TrackedTask<R, E>
impl<R, E> !Sync for TrackedTask<R, E>
impl<R, E> Unpin for TrackedTask<R, E>
impl<R, E> UnsafeUnpin for TrackedTask<R, E>
impl<R, E> !UnwindSafe for TrackedTask<R, E>
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<T> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more