# Trait core::task::Executor[−][src]

    pub trait Executor {
        fn spawn_obj(&mut self, task: TaskObj) -> Result<(), SpawnObjError>;

        fn status(&self) -> Result<(), SpawnErrorKind> { ... }
    }

🔬 This is a nightly-only experimental API. (`futures_api` #50547)

futures in libcore are unstable

A task executor.

A task is a `()`-producing async value that runs at the top level, and will be `poll`ed until completion. It's also the unit at which wake-up notifications occur. Executors, such as thread pools, allow tasks to be spawned and are responsible for putting tasks onto ready queues when they are woken up, and polling them when they are ready.

## Required Methods

### `fn spawn_obj(&mut self, task: TaskObj) -> Result<(), SpawnObjError>`

🔬 This is a nightly-only experimental API. (`futures_api` #50547)

futures in libcore are unstable

Spawn the given task, polling it until completion.

# Errors

The executor may be unable to spawn tasks, either because it has been shut down or is resource-constrained.

## Provided Methods

### `fn status(&self) -> Result<(), SpawnErrorKind>`

🔬 This is a nightly-only experimental API. (`futures_api` #50547)

futures in libcore are unstable

Determine whether the executor is able to spawn new tasks.

# Returns

An `Ok` return means the executor is likely (but not guaranteed) to accept a subsequent spawn attempt. Likewise, an `Err` return means that `spawn` is likely, but not guaranteed, to yield an error.

## Implementors

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g. `str,u8` or `String,struct:Vec,test`)