Abortable

Trait Abortable 

Source
pub trait Abortable {
    // Required methods
    fn abort_task(&self);
    fn was_aborted(&self) -> bool;
}
Expand description

Abstraction over tasks that can be aborted (such as join or abort handles).

Required Methods§

Source

fn abort_task(&self)

Notifies the task that it should abort.

Must be idempotent and not panic if it was already called before, due to implementation-specific semantics of Abortable::was_aborted.

Source

fn was_aborted(&self) -> bool

Returns true if abort_task was already called or the task has finished.

It is implementation-specific whether true actually means that the task has been finished. The Abortable::abort_task therefore can be also called if true is returned without a consequence.

Implementations on Foreign Types§

Source§

impl<'a, T: 'a + Abortable + ?Sized> Abortable for &'a T

Source§

impl<T: Abortable + ?Sized> Abortable for Box<T>

Source§

impl<T: Abortable + ?Sized> Abortable for Arc<T>

Implementors§

Source§

impl Abortable for JoinHandle<()>

Available on crate feature runtime-tokio only.
Source§

impl Abortable for AbortHandle

Source§

impl<T> Abortable for AbortableList<T>