pub struct CompletionHandle { /* private fields */ }Expand description
Handle for awaiting the completion of an accepted input.
Implementations§
Source§impl CompletionHandle
impl CompletionHandle
Sourcepub async fn try_wait(self) -> Result<CompletionOutcome, CompletionWaitError>
pub async fn try_wait(self) -> Result<CompletionOutcome, CompletionWaitError>
Wait for the input to reach a terminal state or report mechanical waiter failure.
Sourcepub async fn try_wait_with_cleanup_observation(
self,
) -> Result<(CompletionOutcome, CompletionCleanupObservation), CompletionWaitError>
pub async fn try_wait_with_cleanup_observation( self, ) -> Result<(CompletionOutcome, CompletionCleanupObservation), CompletionWaitError>
Wait for completion and return the generated cleanup observation carried with the authorized public outcome.
Sourcepub async fn wait(self) -> Result<CompletionOutcome, CompletionWaitError>
pub async fn wait(self) -> Result<CompletionOutcome, CompletionWaitError>
Wait for the input to reach a terminal state or report mechanical waiter failure.
Sourcepub fn with_cleanup<F, Fut>(self, cleanup: F) -> Self
pub fn with_cleanup<F, Fut>(self, cleanup: F) -> Self
Relay completion through a cleanup future before resolving the returned handle. This lets surfaces transfer cleanup ownership immediately after accepting runtime work while still returning a completion handle.
Sourcepub fn with_outcome_cleanup<F, Fut>(self, cleanup: F) -> Self
pub fn with_outcome_cleanup<F, Fut>(self, cleanup: F) -> Self
Relay completion through a cleanup future that can inspect the outcome.
The cleanup future receives a runtime-minted cleanup observation and cannot replace the completion result.
Sourcepub fn with_completion_cleanup<F, Fut>(self, cleanup: F) -> Selfwhere
F: FnOnce(Result<CompletionCleanupObservation, CompletionWaitError>) -> Fut + Send + 'static,
Fut: Future<Output = ()> + Send + 'static,
pub fn with_completion_cleanup<F, Fut>(self, cleanup: F) -> Selfwhere
F: FnOnce(Result<CompletionCleanupObservation, CompletionWaitError>) -> Fut + Send + 'static,
Fut: Future<Output = ()> + Send + 'static,
Relay completion through cleanup that can observe either generated completion-cleanup evidence or a typed waiter failure.