[][src]Enum async_runtime::ErrorKind

pub enum ErrorKind {
    DoubleExecutorInit,
    Spawn,
    Run,
    SpawnLocalOnThreadPool,
    WrongExecutor,
    NoExecutorInitialized,
    __Nonexhaustive,
}

The different kind of errors that can happen when you use the async_runtime API.

Variants

DoubleExecutorInit

You should not call init twice on the same thread. In general if you are a library author, you should not call it unless you started the thread. Otherwise just call spawn and let the client code decide which executor shall be used. If you need to call init several times, you can either verify no executor is set first (with current_rt) or use init_allow_same

Spawn

A backend error happened while trying to spawn:

  • Spawning is infallible on: juliex, async-std, bindgen..
  • Spawning on localpool can fail with futures::task::SpawnError. The only reason for this is that the executor was shut down. In principle this cannot happen with async_runtime.
Run

An error happened when running an executor to completion. This is returned by tokio_ct::run.

SpawnLocalOnThreadPool

When some code in your project (possibly a dependency) uses spawn_local because the future they spawn is !Send, you must use the localpool for the thread in which this code is run. It's simply not possible to spawn a !Send future on a threadpool.

WrongExecutor

You tried to use a functionality specific to a certain executor while another executor was being used for this thread.

NoExecutorInitialized

You tried to call a spawn function on a thread that has no executor initialized. Please use init first.

__Nonexhaustive

Protect against adding other options being breaking changes.

Trait Implementations

impl Clone for ErrorKind[src]

impl Copy for ErrorKind[src]

impl Debug for ErrorKind[src]

impl Display for ErrorKind[src]

impl Eq for ErrorKind[src]

impl From<ErrorKind> for Error[src]

impl PartialEq<ErrorKind> for ErrorKind[src]

impl StructuralEq for ErrorKind[src]

impl StructuralPartialEq for ErrorKind[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.