pub struct ScheduledTaskHandle<R, E> { /* private fields */ }Expand description
Tracked handle for a task accepted by a scheduled executor service.
The handle delegates result and status observation to the standard
TrackedTask while also waking the scheduler when pre-start cancellation
wins. This prevents a cancelled timer entry from keeping the single scheduler
thread asleep until the original deadline.
Implementations§
Source§impl<R, E> ScheduledTaskHandle<R, E>
impl<R, E> ScheduledTaskHandle<R, E>
Sourcepub fn get(self) -> TaskResult<R, E>
pub fn get(self) -> TaskResult<R, E>
Sourcepub fn try_get(self) -> TryGet<Self, R, E>
pub fn try_get(self) -> TryGet<Self, R, E>
Attempts to retrieve the final result without blocking.
§Returns
A ready result or the pending scheduled 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.
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 ScheduledTaskHandle<R, E>
impl<R, E> IntoFuture for ScheduledTaskHandle<R, E>
Source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Converts this scheduled handle into a future resolving to the task result.
Source§type Output = Result<R, TaskExecutionError<E>>
type Output = Result<R, TaskExecutionError<E>>
Source§type IntoFuture = TaskHandleFuture<R, E>
type IntoFuture = TaskHandleFuture<R, E>
Source§impl<R, E> TaskResultHandle<R, E> for ScheduledTaskHandle<R, E>
impl<R, E> TaskResultHandle<R, E> for ScheduledTaskHandle<R, E>
Source§impl<R, E> TrackedTaskHandle<R, E> for ScheduledTaskHandle<R, E>
impl<R, E> TrackedTaskHandle<R, E> for ScheduledTaskHandle<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.