pub trait AfterHandle<F: Send + 'static, E>: Send + Detach + Future<Output = Result<F, AfterHandleError<E>>> + 'static {
    // Required method
    fn cancel(
        self
    ) -> impl Future<Output = Option<Result<F, AfterHandleError<E>>>> + Send;
}
Available on crate feature time only.
Expand description

The handle returned by the AsyncAfterSpawner when a after future is spawned.

Drop the handle to detach the task.

Required Methods§

source

fn cancel( self ) -> impl Future<Output = Option<Result<F, AfterHandleError<E>>>> + Send

Cancels the task related to this handle.

Returns the task’s output if it was completed just before it got canceled, or None if it didn’t complete.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<O> AfterHandle<O, Infallible> for AsyncStdAfterHandle<O>
where O: Send + 'static,

Available on crate feature async-std only.
source§

impl<O> AfterHandle<O, Canceled> for SmolAfterHandle<O>
where O: Send + 'static,

Available on crate feature smol only.
source§

impl<O> AfterHandle<O, Canceled> for WasmAfterHandle<O>
where O: Send + 'static,

Available on crate feature wasm only.
source§

impl<O> AfterHandle<O, JoinError> for TokioAfterHandle<O>
where O: Send + 'static,

Available on crate feature tokio only.