[][src]Trait dogear::AbortSignal

pub trait AbortSignal {
    fn aborted(&self) -> bool;

    fn err_if_aborted(&self) -> Result<()> { ... }
}

An abort signal is used to abort merging. Implementations of AbortSignal can store an aborted flag, usually as an atomic integer or Boolean, set the flag on abort, and have AbortSignal::aborted return the flag's value.

Since merging is synchronous, it's not possible to interrupt a merge from the same thread that started it. In practice, this means a signal will implement Send and Sync, too, so that another thread can set the aborted flag.

The name comes from the AbortSignal DOM API.

Required methods

fn aborted(&self) -> bool

Indicates if the caller signaled to abort.

Loading content...

Provided methods

fn err_if_aborted(&self) -> Result<()>

Returns an error if the caller signaled to abort. This helper makes it easier to use the signal with the ? operator.

Loading content...

Implementors

impl AbortSignal for DefaultAbortSignal[src]

fn err_if_aborted(&self) -> Result<()>[src]

Loading content...