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 wait(self) -> CompletionOutcome
pub async fn wait(self) -> CompletionOutcome
Wait for the input to reach a terminal state.
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) -> Selfwhere
F: FnOnce(CompletionOutcome) -> Fut + Send + 'static,
Fut: Future<Output = CompletionOutcome> + Send + 'static,
pub fn with_outcome_cleanup<F, Fut>(self, cleanup: F) -> Selfwhere
F: FnOnce(CompletionOutcome) -> Fut + Send + 'static,
Fut: Future<Output = CompletionOutcome> + Send + 'static,
Relay completion through a cleanup future that can inspect the outcome.
The cleanup future owns and returns the outcome so callers can run outcome-specific teardown without losing the completion result.
Sourcepub fn already_resolved(outcome: CompletionOutcome) -> Self
pub fn already_resolved(outcome: CompletionOutcome) -> Self
Create a handle from a pre-resolved outcome.
Used when the input is already terminal (e.g. dedup of completed input) and no waiter registration is needed.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CompletionHandle
impl !RefUnwindSafe for CompletionHandle
impl Send for CompletionHandle
impl Sync for CompletionHandle
impl Unpin for CompletionHandle
impl UnsafeUnpin for CompletionHandle
impl !UnwindSafe for CompletionHandle
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