pub trait LocalAfterHandle<F: 'static, E>: Detach + Future<Output = Result<F, AfterHandleError<E>>> + 'static {
    // Required methods
    fn cancel(
        self
    ) -> impl Future<Output = Option<Result<F, AfterHandleError<E>>>>;
    fn reset(&self, duration: Duration);
    fn abort(self);
    fn is_expired(&self) -> bool;
    fn is_finished(&self) -> bool;
}
Available on crate feature time only.
Expand description

The handle returned by the AsyncLocalAfterSpawner 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>>>>

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.

source

fn reset(&self, duration: Duration)

Resets the delay of the task related to this handle.

source

fn abort(self)

Aborts the task related to this handle.

source

fn is_expired(&self) -> bool

Returns true if the timer has expired.

source

fn is_finished(&self) -> bool

Returns true if the task has finished.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<O> LocalAfterHandle<O, Infallible> for AsyncStdAfterHandle<O>
where O: 'static,

Available on crate feature async-std only.
source§

impl<O> LocalAfterHandle<O, Canceled> for SmolAfterHandle<O>
where O: 'static,

Available on crate feature smol only.
source§

impl<O> LocalAfterHandle<O, Canceled> for WasmAfterHandle<O>
where O: 'static,

Available on crate feature wasm only.
source§

impl<O> LocalAfterHandle<O, JoinError> for TokioAfterHandle<O>
where O: 'static,

Available on crate feature tokio only.