pub struct RayonTaskHandle<R, E> { /* private fields */ }Expand description
Tracked handle returned by crate::RayonExecutorService for accepted tasks.
This handle supports blocking Self::get, asynchronous .await, status
inspection, and best-effort cancellation before a Rayon worker starts the
task.
Implementations§
Source§impl<R, E> RayonTaskHandle<R, E>
impl<R, E> RayonTaskHandle<R, E>
Sourcepub fn get(self) -> TaskResult<R, E>
pub fn get(self) -> TaskResult<R, E>
Waits for the task to finish and returns its final result.
§Returns
The final task result reported through the underlying tracked task.
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 Rayon task handle.
Sourcepub fn cancel(&self) -> CancelResult
pub fn cancel(&self) -> CancelResult
Attempts to cancel the task before any Rayon worker starts it.
§Returns
The observed cancellation outcome.
Sourcepub fn is_done(&self) -> bool
pub fn is_done(&self) -> bool
Returns whether the task has reported completion.
§Returns
true after the task has finished or has been cancelled.
Sourcepub fn status(&self) -> TaskStatus
pub fn status(&self) -> TaskStatus
Returns the currently observed task status.
§Returns
The task’s pending, running, or terminal status.
Trait Implementations§
Source§impl<R, E> IntoFuture for RayonTaskHandle<R, E>
impl<R, E> IntoFuture for RayonTaskHandle<R, E>
Source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Converts this 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 RayonTaskHandle<R, E>
impl<R, E> TaskResultHandle<R, E> for RayonTaskHandle<R, E>
Source§impl<R, E> TrackedTaskHandle<R, E> for RayonTaskHandle<R, E>
impl<R, E> TrackedTaskHandle<R, E> for RayonTaskHandle<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
Cancels the task through the owning service state.
Auto Trait Implementations§
impl<R, E> Freeze for RayonTaskHandle<R, E>
impl<R, E> !RefUnwindSafe for RayonTaskHandle<R, E>
impl<R, E> Send for RayonTaskHandle<R, E>
impl<R, E> !Sync for RayonTaskHandle<R, E>
impl<R, E> Unpin for RayonTaskHandle<R, E>
impl<R, E> UnsafeUnpin for RayonTaskHandle<R, E>
impl<R, E> !UnwindSafe for RayonTaskHandle<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
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>
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>
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