pub trait TaskResultHandle<R, E>: Send {
// Required methods
fn is_done(&self) -> bool;
fn get(self) -> TaskResult<R, E>
where Self: Sized;
fn try_get(self) -> TryGet<Self, R, E>
where Self: Sized;
}Expand description
Common interface for handles that expose a submitted task’s final result.
Required Methods§
Sourcefn is_done(&self) -> bool
fn is_done(&self) -> bool
Returns whether the task has installed a terminal state.
§Returns
true after the task has reached a terminal lifecycle state. Result
publication to the handle may still be racing with this observation.
Sourcefn get(self) -> TaskResult<R, E>where
Self: Sized,
fn get(self) -> TaskResult<R, E>where
Self: Sized,
Blocks until the task produces its final result.
§Returns
The final task result. If the completion endpoint is dropped without publishing a result, a dropped-result error is reported.
Sourcefn try_get(self) -> TryGet<Self, R, E>where
Self: Sized,
fn try_get(self) -> TryGet<Self, R, E>where
Self: Sized,
Attempts to retrieve the final result without blocking.
§Returns
TryGet::Ready when a result is available, otherwise
TryGet::Pending containing the original handle.