deno_core

Trait CancelFuture

Source
pub trait CancelFuture
where Self: Future + Sized,
{ // Provided methods fn or_cancel<H: RcLike<CancelHandle>>( self, cancel_handle: H, ) -> Cancelable<Self> { ... } fn or_abort<H: RcLike<CancelHandle>>( self, cancel_handle: H, ) -> Abortable<Self> where Self: Unpin { ... } }

Provided Methods§

Source

fn or_cancel<H: RcLike<CancelHandle>>( self, cancel_handle: H, ) -> Cancelable<Self>

Source

fn or_abort<H: RcLike<CancelHandle>>(self, cancel_handle: H) -> Abortable<Self>
where Self: Unpin,

For unpinnable futures, returns the future on cancellation rather than an error.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<F> CancelFuture for F
where F: Future,