[][src]Trait executor_trait::Executor

pub trait Executor {
    pub fn block_on(&self, f: Pin<Box<dyn Future<Output = ()>>>);
pub fn spawn(
        &self,
        f: Pin<Box<dyn Future<Output = ()> + Send>>
    ) -> Box<dyn Task>; pub fn spawn_local(
        &self,
        f: Pin<Box<dyn Future<Output = ()>>>
    ) -> Result<Box<dyn Task>, LocalExecutorError> { ... } }

A common interface for spawning futures on top of an executor

Required methods

pub fn block_on(&self, f: Pin<Box<dyn Future<Output = ()>>>)[src]

Block on a future until completion

pub fn spawn(
    &self,
    f: Pin<Box<dyn Future<Output = ()> + Send>>
) -> Box<dyn Task>
[src]

Spawn a future and return a handle to track its completion.

Loading content...

Provided methods

pub fn spawn_local(
    &self,
    f: Pin<Box<dyn Future<Output = ()>>>
) -> Result<Box<dyn Task>, LocalExecutorError>
[src]

Spawn a non-Send future on the current thread and return a handle to track its completion.

Loading content...

Implementors

impl<E: Deref + Sync> Executor for E where
    E::Target: Executor + Sync
[src]

Loading content...