pub struct TaskEndpointPair<R, E> { /* private fields */ }Expand description
One-shot pair of endpoints for a task submission.
A pair owns the shared task completion endpoint and the result receiver
until it is split into caller-facing and runner-facing endpoints. Pairs
created with Self::new do not install a lifecycle hook, avoiding the
allocation and dynamic dispatch cost of a no-op hook on the default path.
Custom executors using this SPI should call TaskSlot::accept or the
crate-internal handle acceptance path only after submission has succeeded.
Dropping a runner slot before acceptance releases result waiters with
Dropped but does not emit hook lifecycle events.
Implementations§
Source§impl<R, E> TaskEndpointPair<R, E>
impl<R, E> TaskEndpointPair<R, E>
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new unsplit task completion pair without lifecycle hooks.
§Returns
A pair that can be split once into its handle and completion endpoints.
Sourcepub fn into_parts(self) -> (TaskHandle<R, E>, TaskSlot<R, E>)
pub fn into_parts(self) -> (TaskHandle<R, E>, TaskSlot<R, E>)
Splits this pair into a result handle and completion endpoint.
§Returns
A TaskHandle for the caller and a TaskSlot for the runner.
Sourcepub fn into_tracked_parts(self) -> (TrackedTask<R, E>, TaskSlot<R, E>)
pub fn into_tracked_parts(self) -> (TrackedTask<R, E>, TaskSlot<R, E>)
Splits this pair into a tracked result handle and completion endpoint.
§Returns
A TrackedTask for the caller and a TaskSlot for the runner.