pub struct TaskCompletionPair<R, E> { /* private fields */ }Expand description
One-shot pair of endpoints for an accepted task.
A pair owns the shared task state until it is split into a caller-facing
TaskHandle and a runner-facing TaskCompletion.
Implementations§
Source§impl<R, E> TaskCompletionPair<R, E>
impl<R, E> TaskCompletionPair<R, E>
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new unsplit task completion pair.
§Returns
A pair that can be split once into its handle and completion endpoints.
Sourcepub fn into_parts(self) -> (TaskHandle<R, E>, TaskCompletion<R, E>)
pub fn into_parts(self) -> (TaskHandle<R, E>, TaskCompletion<R, E>)
Splits this pair into caller and runner endpoints.
§Returns
A TaskHandle for the caller and a TaskCompletion for the runner.
Trait Implementations§
Auto Trait Implementations§
impl<R, E> Freeze for TaskCompletionPair<R, E>
impl<R, E> RefUnwindSafe for TaskCompletionPair<R, E>
impl<R, E> Send for TaskCompletionPair<R, E>
impl<R, E> Sync for TaskCompletionPair<R, E>
impl<R, E> Unpin for TaskCompletionPair<R, E>
impl<R, E> UnsafeUnpin for TaskCompletionPair<R, E>
impl<R, E> UnwindSafe for TaskCompletionPair<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