[−][src]Trait executor_trait::Executor
A common interface for spawning futures and blocking tasks 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]
&self,
f: Pin<Box<dyn Future<Output = ()> + Send>>
) -> Box<dyn Task>
Spawn a future and return a handle to track its completion.
pub fn spawn_local(&self, f: Pin<Box<dyn Future<Output = ()>>>) -> Box<dyn Task>
[src]
Spawn a non-Send future on the current thread and return a handle to track its completion.
#[must_use]pub fn spawn_blocking<'life0, 'async_trait>(
&'life0 self,
f: Box<dyn FnOnce() + Send + 'static>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
f: Box<dyn FnOnce() + Send + 'static>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Convert a blocking task into a future, spawning it on a decicated thread pool
Implementors
impl<E: Deref + Sync> Executor for E where
E::Target: Executor + Sync,
[src]
E::Target: Executor + Sync,
pub fn block_on(&self, f: Pin<Box<dyn Future<Output = ()>>>)
[src]
pub fn spawn(
&self,
f: Pin<Box<dyn Future<Output = ()> + Send>>
) -> Box<dyn Task>
[src]
&self,
f: Pin<Box<dyn Future<Output = ()> + Send>>
) -> Box<dyn Task>
pub fn spawn_local(&self, f: Pin<Box<dyn Future<Output = ()>>>) -> Box<dyn Task>
[src]
pub fn spawn_blocking<'life0, 'async_trait>(
&'life0 self,
f: Box<dyn FnOnce() + Send + 'static>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
f: Box<dyn FnOnce() + Send + 'static>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,